Python change pip source

Python change pip source

There pip source

The new ubuntu require the use of https source, to pay attention.
Tsinghua: https: //pypi.tuna.tsinghua.edu.cn/simple
Ali cloud: http: //mirrors.aliyun.com/pypi/simple/
China University of Science and Technology https://pypi.mirrors.ustc.edu.cn / simple /
Huazhong University of Science: http: //pypi.hustunique.com/
Shandong University of Technology: http: //pypi.sdutlinux.org/
watercress: http: //pypi.douban.com/simple/

 

Windows change mode:

Create a directory pip directly in the user directory, such as: C: \ Users \ xx \ pip, the new file pip.ini

Contents of the file:

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

A Case Study at Tsinghua source

 

Linux change mode:

Pip.conf create a file in the user's home directory .pip directory, if no directory .pip create your own.

mkdir ~ / the .pip 

cd ~ / the .pip 

Touch pip.conf 

# edit pip.conf file 
sudo gedit ~ / the .pip / pip.conf

Copy the following files into pip.conf

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

A Case Study at Tsinghua source

Guess you like

Origin www.cnblogs.com/zhx-blog/p/11619809.html