Python replaces domestic pip source under windows

Python replaces domestic pip source under windows

foreword

Under Windows, when using the pip install command, the following situation occurs: The
insert image description here
corresponding server connection fails . In this case, the pip source can be replaced

Replace Windows source


Enter the directory under Windows

C:\Users\计算机用户名

Create a new folder for pip
insert image description here
, enter the pip folder, create a new TXT text file, name it pip.ini,
insert image description here
edit the "pip.ini" file, and add the following content:
Ali source:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com

University of Science and Technology of China

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

Tsinghua University Source

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

Doubanyuan

[global]
index-url = http://pypi.douban.com/simple/
[install]
trusted-host = mirrors.douban.com

save after modification

test

pip install pyinstaller

insert image description here
success! ! !

Guess you like

Origin blog.csdn.net/weixin_50679163/article/details/122392249