Linux environment:
You can use the mirror source directly, add -i to specify the address:
1 sudo pip install -i 模块名
If an untrusted error occurs:
You need to add
1 sudo pip install -i --trusted-host pypi.douban.com 模块名
after the command. It is troublesome to enter the address every time. You can change the default configuration, ~/.pip /pip.conf, generally this file needs to be created by yourself.
File content:
1 [global]2 index-url = simple3 [install]4 trusted-host=pypi.douban.com
Windows environment:
Like Linux, it can be installed directly through the command line.
If you need to modify the default configuration, you need to create a new pip folder and pip.inf file under the current user.
#The configuration content is the same as that of Linux.
After the new file is created, append: %USERPROFILE%\pip\pip.ini after the environment variable Path.
The above is the detailed content of Detailed explanation of pip changing domestic source examples. For more information, please follow other related articles on the PHP Chinese website!