window清除pip的镜像的办法2025
开发环境就不应该搞什么镜像,有各种下载速度和版本问题,搞个梯子才是最好的选择
- Using the
pip configcommand - 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.inion Windows~/.config/pip/pip.confon 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.

浙公网安备 33010602011771号