Python extension package installation method details, python Installation Method
Preface
As a pythoner, you must understand the installation of the package. This language is similar to matlab. It is open-source and shared. As long as you have good methods, it can be used as a library for downloading and using, after all, as the saying goes: "Is life too short, please use Python?". Let's take a look at the detailed introduction below.
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 then run the following command on the console:python setup.py install xxx
You can.
3. Install with easy_install
Prerequisites: The easy_install tool is installed. If it is not installed, download ez_setup.py and runpython ez_setup
Install the easy_install tool. [Installed in D: \ py \ Scripts by default]
Then useeasy_install packageName/package.egg
Command to install
4. Install using pip
Note: pip must be installed. If you do not have pip installed, download https://pypi.python.org/pypi/pip#downloadsto decompress the SDK.python setup.py
Install [installed in D: \ py \ Scripts by default]
Usepip -help
You can view some common pip commands.
Then use
1>pip install packageName
To install
2> or use the whl file to installpip install xxx.whl
Install
Note:Download the whl file. It must match the current python version and system. It can be used in the python shell.
import pip
print pip.pep425tags.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 installing with pip or easy_install, your machine must be connected to the Internet.
Summary
The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.