How to install extension packages in Python

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.