Python installation and a variety of packages / libraries on a computer can not be networked

We may encounter when doing the project, some computer can only be linked within the network or the Internet does not, this situation how to install Python and various third-party packages / libraries on the computer?

1. First, the computer has a good network to download the installation package python in python official website address: https://www.python.org/downloads/windows/
attention to determine the version. This copy installed on your computer, add Python and pip attention to environment variables.

2. Installation coated with a third party package installed

Generally, we installed on a networked computer bag is very simple, direct use of the command will be able to pip packages and package dependencies installed a one-time, this approach is linked to a Web page, download and install from the web.

No networked computer is more complicated, because some packages may depend on more than a dozen other packages, in which case you can only use the downloaded installation package manually install the target installation package of all dependencies.

Download here offers two:

Address. 1; https://pypi.org/ , the search box direct search, depending on the version of the Python, the computer operating system configuration file corresponding to the selected .whl.

 

 

Address 2: https://www.lfd.uci.edu/~gohlke/pythonlibs/ , you can use Ctrl + F search. This page can see which packages depend on the package, install the package that is required to install the prerequisite is to first install the dependent packages. Otherwise, after you install, import error.

The two URLs can be used in combination.

Installation process:

1) Download the file from the URL .whl provided above

2).打开cmd,cd到安装包所在的文件夹,然后用pip install 安装包文件名,如matplotlib包:pip install matplotlib‑3.1.1‑cp36‑cp36m‑win_amd64.whl

3)验证包是否安装成功。cmd中进入Python终端,输入import 包名称。如果不报错,则安装成功;否则,根据错误提示安装缺少的依赖包。

 

Guess you like

Origin www.cnblogs.com/taotingz/p/11309757.html