Loading

window清除pip的镜像的办法2025

开发环境就不应该搞什么镜像,有各种下载速度和版本问题,搞个梯子才是最好的选择

  1. Using the pip config command
  2. Editing the pip.conf file directly

To change the trusted-host setting, use one of these methods:

Method 1: Using pip config command

pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn

Or to set multiple trusted hosts:

pip config set global.trusted-host "pypi.tuna.tsinghua.edu.cn mirrors.aliyun.com"

Method 2: Edit pip.ini directly

The configuration file is typically located at:

  • %APPDATA%\pip\pip.ini on Windows
  • ~/.config/pip/pip.conf on Linux/Mac

You can edit it to include:

[global]
trusted-host = pypi.tuna.tsinghua.edu.cn

To remove a setting:

pip config unset global.trusted-host

Note that in your original attempts, you were trying to use the settings as if they were commands, which is why you got "unknown command" errors. The correct approach is to use pip config set or pip config unset as shown above.

posted @ 2025-06-30 17:05  hllqk  阅读(79)  评论(0)    收藏  举报