[Solved] How to install python third-party package offline under windows?

How to download the offline package?
Method 1:
Official website: https://pypi.org/
insert image description here
insert image description here
Method 2:
Website: https://www.lfd.uci.edu/~gohlke/pythonlibs/
insert image description here
insert image description here
corresponding to the windows system, of course choose the .whl file After downloading, win+r, enter cmd and press Enter, and then

python安装路径 -m pip install package

Among them, the python installation path is accurate to the python.exe file, and package refers to a third-party package, such as numpy
. Of course, the above execution method is not configured with global variables.

Next, what I will share is how to copy it to another computer if there is already a third-party package on one computer.
Take numpy as an example.
On the computer that already has a third-party package, win+r, enter cmd, and enter the terminal
(the following demonstration is in pip has been installed, and python has been configured globally)

pip show numpy

insert image description here
At this time, you can get the location of the installation package. There is a misunderstanding here. Someone will copy the numpy folder of sit-packages and throw it directly on the computer that does not have numpy installed. Is this okay?
Of course not!
insert image description here
In layman's terms, the .whl package contains dependencies. If you simply copy this folder, it will not be recognized. Interested friends can try to copy the dependencies and folders together. Now, how to get the .whl package of
numpy Woolen cloth

pip download numpy

insert image description here

Install
on an offline computer, win+r, enter cmd to enter the terminal operation

pip install xxx.whl

If there is no global configuration offline, then

python安装路径 -m pip install package.whl

The parameters are described above

Guess you like

Origin blog.csdn.net/m0_57021623/article/details/127643215