这篇文章将解除你使用python的pip install xxx受到的网速限制,如果只是下载较小的第三方库,可以尝试pip --default-timeout=100 install -U xxx

  1. 找到python安装目录下的:\Lib\site-packages\pip\models\index.py文件,将PYPI的值改为你所需要的镜像源即可,例如改为豆瓣镜像源:
#PyPI = Index('https://pypi.python.org/')  
PyPI = Index('https://pypi.douban.com/')  

二、Mac

  1. 在终端进入目录:cd ~
  2. mac用户家目录中新建文件夹:mkdir pip
  3. 然后在.pip 文件夹内新建一个文件 :vi pip.conf,并且写入阿里云镜像:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

 

 

这篇文章将解除你使用python的pip install xxx受到的网速限制,如果只是下载较小的第三方库,可以尝试pip --default-timeout=100 install -U xxx

  1. 找到python安装目录下的:\Lib\site-packages\pip\models\index.py文件,将PYPI的值改为你所需要的镜像源即可,例如改为豆瓣镜像源:
#PyPI = Index('https://pypi.python.org/')  
PyPI = Index('https://pypi.douban.com/')  

二、Mac

  1. 在终端进入目录:cd ~
  2. mac用户家目录中新建文件夹:mkdir pip
  3. 然后在.pip 文件夹内新建一个文件 :vi pip.conf,并且写入阿里云镜像:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

相关文章:

  • 2021-05-24
  • 2021-08-23
  • 2022-01-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-01
  • 2021-08-31
  • 2022-02-03
  • 2021-08-22
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案