"Learn Python with me" Python's package management tool

Source: Internet
Author: User

Just started to learn python, read the document and other people's blog introduction to install the package with Easy_install, Setuptools, and some use of pip,distribute, then what is the relationship between these tools, look at the following diagram to understand


You can see that distribute is the replacement of Setuptools, and Pip is the replacement of Easy_install.

Refer to Http://guide.python-distribute.org/installation.html#installing-pip for these package tools

Here's a quick introduction:

Distribute is an enhancement to the standard library Disutils module, and we know that disutils is primarily used to package and distribute packages more easily, especially for packages that have dependencies on other packages.

Distribute was created because the Setuptools package is no longer maintained.

Installing distribute

Can be installed through the distribute_setup.py script distribute can also be installed through Easy_install, Pip, source files, but the use of distribute_setup.py to install is the simplest and popular way

$ curl-0 http://python-distribute.org/distribute_setup.py
$ sudo python distribute_setup.py

Pip is a tool for installing the Python package, providing an installation package that lists the packages that have been installed, the upgrade package, and the ability to uninstall the package.

Pip is a replacement for Easy_install, which provides the same functionality for finding packages as Easy_install, so packages that can be installed using Easy_install can also be installed using PIP.

Install PIP

PIP installation can be via source code package, Easy_install or script.

Here are the various installation methods:

Source Code mode:

$ wget http://pypi.python.org/packages/source/p/pip/pip-0.7.2.tar.gz (replace with latest package) $ tar xzf pip-0.7.2.tar.gz$ CD pip-0.7.2 $ python setup.py Install

Easy_install:

$ easy_install pip

get_pip.py script:

$ curl-0 https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ sudo python get-pip.py

OK, here's a look at the use of PIP

Install the Package

$ pip Install Markdown

List the installed packages

$ pip Freeze

Install a specific version of the package

by using = =, >=, <=, <, specify a version number.

$ pip Install ' markdown<2.0 '

$ pip Install ' markdown>2.0,<2.0.3 '

Upgrade Package

Upgrade package to current latest version, can use-u or--upgrade

$ pip install-u Markdown

Uninstalling packages

$ pip Uninstall Markdown

Query Package

Pip Search "Markdown"

PS--Package after installation of the Py file path:/usr/local/lib/python2.7/dist-packages

"Learn Python with me" Python's package management tool

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.