window
找到python安装目录下的:\Lib\site-packages\pip\models\index.py文件,将PYPI的值改为你所需要的源即可,例如改为豆瓣的源。
找不到 就直接搜索
#PyPI = Index('https://pypi.python.org/')
PyPI = Index('https://pypi.douban.com/')
必须用https
liunx
linux 修改pip镜像源的方法:
在当前用户的目录下创建.pip文件夹 vim ~/.pip/pip.conf
[global]
trusted-host = pypi.douban.com
index-url = http://pypi.douban.com/simple
检查 是否成功
more /root/.pip/pip.conf