One, Method 1: Single File module
Copy the file directly to the $python _dir/lib
Second, Method 2: Multi-file module, with setup.py
Download the module package (compressed file zip or tar.gz), unzip, CMD->CD into the module folder, execute:
Python setup.py Install
Third, Method 3:easy_install way
Download ez_setup.py First, run Python ez_setup to install the Easy_install tool, and then use Easy_install to install the package (file name, resource URL,. egg file (python Egg file) To download the installation file)
Easy_install PackageName
Easy_install Package.egg
Iv. method 4:pip automatic installation of network search
Install the PIP tool First: Easy_install PIP (Pip can be installed via Easy_install and will also be loaded into the Scripts folder D:\Python2.7\Lib\site-packages)
Install: Pip Install PackageName
Pip Common Commands
Lists the installed Packages:pip freeze
Install a specific version of the package: Specify a version number by using = =, >=, <=, <;
$ pip Install ' markdown<2.0 '
$ pip Install ' markdown>2.0,<2.0.3 '
Upgrade the package to the most current version, you can use-U or--upgrade:
Upgrade package PIP Install-u Markdown
Unload Package: Pip Uninstall Markdown
Query package: Pip Search "Markdown"
V. Method 5:.WHL file pip mode
Download the corresponding module. WHL file, enter the directory where the. whl file is located under the CMD->CD command, if the PIP directory is not added to the environment variable, it is best to place the. whl file in the directory where Pip.exe is located (D:\Python2.7\Scripts\).
Install: Pip install package name. WHL
Vi. method 6:.exe File Custom Installation
Download the corresponding version of EXE installation files, such as Numpy-1.9.2-win32-superpack-python2.7.exe and Mlpy-3.5.0.win32-py2.7.exe
Install: Turn on automatic installation
Python package, 6 ways to install a library