美文网首页
解决pip安装包速度慢的问题

解决pip安装包速度慢的问题

作者: YPCHEN1992 | 来源:发表于2020-03-14 23:18 被阅读0次

使用pip 安装包,由于网络的原因,经常会报出一下这样的错误:


pip error.png

pip 默认的安装源

'''
https://pypi.org/simple  # 网络问题,国内就是巨慢
'''

解决办法,切换包的安装镜像源

pip help install # 查看pip install 命令的帮助信息
'''
Package Index Options: 
  -i, --index-url <url>       Base URL of the Python Package Index (default https://pypi.org/simple). This should point to a
                              repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the
                              same format.
'''
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/

国内主要镜像

'''
阿里云 https://mirrors.aliyun.com/pypi/simple/
豆瓣 https://pypi.doubanio.com/simple/
网易 https://mirrors.163.com/pypi/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科技大学 http://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学 http://pypi.hustunique.com/simple/
山东理工大学 http://pypi.sdutlinux.org/simple/  ## 在线测试,没打开2020-04-05
...
'''

相关文章

网友评论

      本文标题:解决pip安装包速度慢的问题

      本文链接:https://www.haomeiwen.com/subject/wytashtx.html