About the download methods and skills of python modules

A pip install [module name] method and its individual problems and solutions.

The pip install download is a very convenient way to download, through which you can easily download the third-party libraries about python you want. Here is an example of downloading opencv.

pip3 install opencv-python

Of course, first make sure you have python3 and pip installed. For those who have not installed pip, please download get-pip.py first, and then enter cmd in the search to open the command window. Enter the location where pip is saved, dir confirm whether there is the pip installation package Insert picture description here
you just downloaded and then you can wait happily. However, if you guessed correctly, you will encounter this situation:
Insert picture description here
and then
Insert picture description here
(please don’t care about my desktop background)
. Obviously, the download speed is slow and timed out, so at this time we must use the domestic mirror

(Manually) Download mirror selection!

Here is the mirror image of
Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple (I said I can pass the exam , believe it or not)

Alibaba Cloud: http://mirrors.aliyun.com/pypi/simple/

University of Science and Technology of China https://pypi.mirrors.ustc.edu.cn/simple/

Huazhong University of Science and Technology: http://pypi.hustunique.com/

** Shandong University of Technology: http://pypi.sdutlinux.org/ **

Douban: http://pypi.douban.com/simple/ How to
use
Take Douban as an example:

pip install -i https://pypi.douban.com/simple 【需要安装的包】
比如:
pip install -i https://pypi.douban.com/simple opencv-python

Insert picture description here

(Automatic) Mirror selection

On my computer, search for %APPDATA% (representing system variables) to
Insert picture description here
create a pip folder, and create a pip.ini file in the folder. The contents of the file are as follows:

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

Insert picture description here

Download offline package

Enter the module URL of this website
Insert picture description here
**CTRL + F **
as shown below: Enter the module
Insert picture description here
you want (I take opencv as an example here) and it should be almost ready to download.
Then cmd input:

pip install 【下载好的文件】.whl

(I won’t write crawler tutorials in the future, I’m too lazy to write, I will mainly write some trouble-making (practical) tutorials in the future, limited by time and updated irregularly)

Guess you like

Origin blog.csdn.net/FUTEROX/article/details/102528167