003 Python解释器源修改

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

1、Windows阿里云

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

2、Macurl

  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
相关文章
相关标签/搜索