How to install Python packages and modules under Windows (pro-test manual installation)

1. pip installation In the
previous chapter, the installation of Anaconda was introduced. After installing Anaconda, the package management tool pip was installed by default. Some people like to use easy_install, but this requires you to install easy_install first, in fact, it is not necessary, currently the official recommendation is to use pip.

The pip installation package or module is very simple, we only need to use the command pip install xxx in the command prompt (cmd) window (xxx indicates the name of the package or module to be installed). 
For example: 
 
if you want to uninstall after installing (package or module), you can use the command pip uninstall xxx.

2. Download file installation
If we fail to install using pip, then we can directly download the installation file of the package or module, and then install it manually.

Two commonly used websites for downloading packages and module installation files: PyPI-the Python Package Index and Python Extension Packages.

2.1 PyPI-the Python Package Index
This website is the PyPI option on the official Python website. Click to enter: 
 
enter the name of the package or module you want to download in the search framed by the red line in the upper right corner above, and you will enter the download page. The download is a compressed file, how to install it? 
1) Unzip 
2) In the command prompt window, use cd to enter the path of the decompressed file 
3) Enter the command python setup.py install

2.2 The Python Extension Packages
website downloads files with the suffix .whl. How do I run the downloaded .whl installation file? 
1) In the command prompt window, find the specified path (the path of the .whl installation file) 
2) pip install .whl file name
————————————————
Copyright Notice: This article is CSDN The original article of the blogger "DQ_DM" follows the CC 4.0 BY-SA copyright agreement. For reprinting, please attach the original source link and this statement.
Original link: https://blog.csdn.net/DQ_DM/article/details/47080755

Published 44 original articles · 130 praises · 1.37 million views

Guess you like

Origin blog.csdn.net/gb4215287/article/details/105502264