When I first started learning Python, I used easy_install, setuptools, and pip and distribute to read the documentation and other blogs to introduce the installation packages. What are the tools when I first started learning Python, some of the installation packages, including easy_install, setuptools, and pip and distribute, are described in the document and other blogs. what is the relationship between these tools? see the figure below.
We can see that distribute is replaced by setuptools, while pip is replaced by easy_install.
Refer to http://guide.python-distribute.org/installation.html#installing-pip for these package tools
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 install distribute_setup.py through the distribute_setup.py script, or install distribute_install, pip, or the source file. However, using distribute_setup.py is the simplest and most popular 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-1, 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
Use ==,>=, <=,>, <来指定一个版本号。< p>
$ 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
The above is a detailed description of the Python package management tool. For more information, see other related articles in the first PHP community!