Including learning package will: increase the download speed pip, pip change the image source

Copyright: Reprinted please contact: [email protected] https://blog.csdn.net/weixin_40928253/article/details/89786547

 When using Python need to install the various modules, and pip is very powerful module installation tool, but often because foreign official pypi wall, resulting in unusable, so we had better be the pip source they use to replace it, so wall solve the cause of trouble is not installed on the library.

1, domestic mirror source

NetEase: http://mirrors.163.com/

Ali: https://opsx.alibaba.com/mirror

Tsinghua: https://mirrors.tuna.tsinghua.edu.cn/

USTC: http://mirrors.ustc.edu.cn/

wait wait wait. . . .

I am more accustomed to using the pip source of Tsinghua University, which is the official network pypi mirroring, synchronization once every 5 minutes

2, change the pip mirror source to domestic mirror source

A, Temporary Use:

You can add parameters -i https://pypi.tuna.tsinghua.edu.cn/simple when using the pip

For example: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent, this will go from the image side of the mounting Tsinghua gevent library.

B, permanent changes:

Under Linux, modify ~ / .pip / pip.conf (not create one), to modify the index-url Tuna, as follows:

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

Under windows, create a directory pip directly in the user directory, such as: C: \ Users \ xx \ pip, the new file pip.ini, reads as follows

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

 

3. Verification:

win + r enter "cmd" window open command input pip install X verification. We can see the source image has changed.

OKK !!

:)

Guess you like

Origin blog.csdn.net/weixin_40928253/article/details/89786547