Home  >  Article  >  Backend Development  >  Detailed explanation of python package manager pip installation

Detailed explanation of python package manager pip installation

高洛峰
高洛峰Original
2016-10-17 17:37:471378browse

pip is no stranger to friends who use python. When you want to install a python module, you will definitely think of it first. pip is a tool for installing and managing Python packages, and is a replacement for easy_install.

Today, let’s talk about how to install pip.

Method 1: Script installation

   
$ wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ [sudo] python get-pip.py

Method 2: Source code installation:

$ curl -O https://pypi.python.org/packages/source/p/pip/pip-X.X.tar.gz
$ tar xvfz pip-X.X.tar.gz
$ cd pip-X.X
$ python setup.py install

But an error may occur during the installation process:

An error occurred while trying to run get-pip.py. Make sure you have setuptools or distribute installed.


This error means that you need to install setuptools first


setuptools installation:

wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

After installing setuptools, just install it from source again.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn