PIP下载安装包失败、超级慢的解决方案

时间:2021-01-29 11:56:43   收藏:0   阅读:0

一、下载源地址修改,用国内镜像站点:

国内源:

新版ubuntu要求使用https源,要注意。

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

豆瓣:http://pypi.douban.com/simple/

临时使用:

可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple

二、Pycharm中修改:

技术图片

 

 

三、Python环境中文件中修改:

..\Lib\site-packages\pip_internal\models\index.py
里面将PYPI的值改为你所需要的源即可,例如改为清华的源。
PyPI = PackageIndex(
‘https://pypi.tuna.tsinghua.edu.cn/simple’, file_storage_domain=‘files.pythonhosted.org’
)

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!