跳到主要内容
版本:Next

Pip

准备工作(必看)

为保证镜像源稳定解析,请在配置前确保hosts文件以及配置正确的域名解析,如若未添加,请在/etc/hosts文件内添加以下内容后再进行镜像源配置

cat >> /etc/hosts << EOF 
10.251.102.1 mirrors.shanhe.com
EOF

pypi 镜像使用帮助

pypi 镜像每 5 分钟同步一次。

临时使用

pip install -i https://mirrors.shanhe.com/simple some-package

注意,simple 不能少, 是 https 而不是 http

设为默认

要求pip 版本 (>=10.0.0) 后进行配置:

pip install -i https://mirrors.shanhe.com/simple pip -U # 升级pip版本,如若满足可以不执行此条命令
pip config set global.index-url https://mirrors.shanhe.com/simple