Python extension package installation method details, python Installation Method

Source: Internet
Author: User

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 xxxYou 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.pyInstall [installed in D: \ py \ Scripts by default]

Usepip -helpYou can view some common pip commands.

Then use

1>pip install packageNameTo 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.

Related Article

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.