pip install 清华源加速

非 Y 不嫁゛ 提交于 2020-01-31 09:57:17

经常要通过pip install安装需要的包,但是每当下载的文件比较大时,网速不够快,会导致报错。所以采用清华源来加速

清华大学开源软件镜像站
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

①临时使用:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package (some-package代表要下载的包)
注意,simple 不能少, 是 https 而不是 http

②设为默认:
修改 ~/.config/pip/pip.conf (Linux), %APPDATA%\pip\pip.ini (Windows 10) 或 $HOME/Library/Application Support/pip/pip.conf (macOS) (没有就创建一个), 修改 index-url至tuna,例如
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

pip 和 pip3 并存时,只需修改 ~/.pip/pip.conf。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!