How to install extension packages in Python
The method is as follows:
1. Single file module
Copy the package to Lib under the python installation directory, for example: D: \ py \ Lib.
2. Multi-file module
Find the zip package (ZIP or tar.gz) to download it, decompress it, and run python setup. py install xxx on the console.
3. Install with easy_install
Prerequisites: The easy_install tool is installed. If it is not installed, download ez_setup.py and run python ez_setup to install the easy_install tool. [Installed in D: \ py \ Scripts by default]
How to install extension packages in Python
Then run the easy_install packageName/package. egg command to install packageName.
4. Install using pip
Prerequisites: pip must be installed. If not, download https://pypi.python.org/pypi/pip?downloads, then decompress it, and enter the installation package to install Python setup. py. [installed in D: \ py \ Scripts by default]
Use pip-help to view some common pip commands
Then use
1> pip install packageName
2> You can also use the whl file to install pip install xxx. whl.
Note: When downloading the whl file, it must match the current python version and system. It can be used in the python shell.
Import pipprint pip. pepw.tags. get_supported () to view the whl file that matches the current version.
Then the downloaded whl file should be a xxxxx-cp27-cp27m-win32.whl.
5. Use exe to customize Installation
Some Lei Feng on the Internet may sometimes make the package into an exe file, so in windows, you can directly click Next to install it.
Note: When pip or easy_install is used, your machine must be connected to the Internet.