When I first started learning Python, I used easy_install, setuptools, and pip and distribute in reading the document and other blogs to introduce the installation packages. What is the relationship between these tools, you can see the figure below.
We can see that distribute is replaced by setuptools, while pip is replaced by easy_install.
For more information about these package tools, seeHttp://guide.python-distribute.org/installation.html#installing-pip
The following is a brief introduction:
Distrils is an enhancement to the standard library's disutils module. We know that disutils is mainly used for easier packaging and distribution of packages, especially for packages that are dependent on other packages.
Distribute is created because the Setuptools package is no longer maintained.
Install Distribute
You can use distribute_setup.pyYou can install Distribute by using easy_install, pip, and source files. However, using distribute_setup.py is the simplest and most popular installation method.
$ curl -0 http://python-distribute.org/distribute_setup.py
$ sudo python distribute_setup.py
Pip is a tool for installing python packages. It provides the installation package to list installed packages, upgrade packages, and uninstall packages.
Pip is a replacement of easy_install and provides the same search Package function as easy_install. Therefore, you can use the package installed by easy_install or pip for installation.
Install Pip
You can use the source code package, easy_install, or script to install Pip.
The following describes various installation methods:
Source code method:
$ Wget http://pypi.python.org/packages/source/p/pip/pip-0.7.2.tar.gz (Replace with the 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. Let's take a look at Pip usage.
Install package
$ pip install Markdown
List Installed packages
$ pip freeze
Install a package of a specific version
You can specify a version number by using ==,>=, <=, >,<.
$ pip install 'Markdown<2.0'
$ pip install 'Markdown>2.0,<2.0.3'
Upgrade package
Upgrade the package to the latest version. You can use-U or -- upgrade
$ pip install -U Markdown
Uninstall package
$ pip uninstall Markdown
Query package
pip search "Markdown"
PS -- path of The py file after package installation:/usr/local/lib/python2.7/dist-packages
Transferred from: http://jiayanjujyj.iteye.com/blog/1409819!