Python permanently specifies the pip source as Douban source

Open the specified directory

C:\Users\username\AppData\Roaming

Then create a pip folder under this folder

In the pip folder, create a pip text file pip.txt

And modify the suffix, change pip.txt to pip.ini
insert image description here

Open pip.ini and enter in the file

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

insert image description here

Close after saving the file. At this time, reopen cmd, you can download and install the third-party library from the domestic Douban source!

Guess you like

Origin blog.csdn.net/weixin_35770067/article/details/131701604