python pip change source

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

豆瓣:http://pypi.douban.com/simple/

temporary use:

可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider,这样就会从清华这边的镜像去安装pyspider库。

Modified forever, once and for all

Linux

Under Linux, modify ~/.pip/pip.conf (create a folder and file if you don’t have it. Add "." to the folder to indicate a hidden folder)

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

 

windows

Under windows, create a pip directory in the user directory, such as C:\Users\xx\pip, and create a new file pip.ini. The content is the same as above.

Guess you like

Origin blog.csdn.net/qq_35576225/article/details/108489109