Home >Backend Development >Python Tutorial >Detailed explanation of pip changing domestic source examples

Detailed explanation of pip changing domestic source examples

零下一度
零下一度Original
2017-06-27 10:23:112604browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:python list parsingNext article:python list parsing