临时使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
注意,simple 不能少, 是 https 而不是 http
设为默认
永久生效
Linux
修改 ~/.config/pip/pip.conf
Windows
修改 %APPDATA%\pip\pip.ini
MacOS
修改 $HOME/Library/Application Support/pip/pip.conf
配置文件内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
另外,pip
和 pip3
并存时,只需修改 ~/.pip/pip.conf
。
本文由 giao创作, 采用 知识共享署名4.0 国际许可协议进行许可 本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名 原文地址:《pip/pip3 更换源》
最后一次更新于2019-06-26
0 条评论