windows: modify pip mirror source for domestic resources

Problem Description

When a foreign mirror source, may be because of network speed or network problem causes the installation to fail, so the change resources for domestic resources, speed up downloads and reduce the failure rate.

problem solved

  1. In the windows file manager, enter %APPDATA%
  2. It will be placed on the next new directory, create pip folder in the directory, and then go to pip folder inside a new pip.inidocument
  3. In the new pip.iniinput file the following, get file path:
    "C:\Users\Administrator\AppData\Roaming\pip\pip.ini"
    watercress Source:
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com

Or Tsinghua Source:

[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn

3. Other sources or temporary replacement

使用国内的资源,速度超级快,不中断

列举如下:
pip install -i https://pypi.douban.com/simple module # 使用豆瓣源
pip install -i http://mirrors.aliyun.com/pypi/simple/ module # 阿里云
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ module # 中国科技大学
pip install -i http://pypi.douban.com/simple/ module # 豆瓣(douban)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ module # 清华大学
pip install -i http://pypi.mirrors.ustc.edu.cn/simple/ module # 中国科学技术大学
##把module换成你要安装的包名即可

reference

  1. [Python] windows at pip change source
  2. Replace the pip source under Windows Tsinghua source
    3. environment permanently modify pip mirroring windows method
Published 98 original articles · won praise 0 · Views 2700

Guess you like

Origin blog.csdn.net/qq_22017379/article/details/104294007