How to install pip, a common download and Installation Tool in Python

Source: Internet
Author: User
This article describes how to install pip, a commonly used download and Installation Tool in Python. Note that pip has been integrated by default in Python2.7.9 and 3.4 and later versions. For more information, see 1. Download and install pip
1.1 pip download

# wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate# wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate

1.2 pip Installation

# tar -xzvf pip-1.5.4.tar.gz# cd pip-1.5.4# python setup.py install# tar -xzvf pip-1.5.4.tar.gz# cd pip-1.5.4# python setup.py install

2. pip Usage Details
2.1 pip installation package

# pip install SomePackage

 [...] Successfully installed SomePackage

# pip install SomePackage

 [...] Successfully installed SomePackage

2.2 pip view installed packages

# pip show --files SomePackage

 Name: SomePackage Version: 1.0 Location: /my/env/lib/pythonx.x/site-packages Files:  ../somepackage/__init__.py  [...]

# pip show --files SomePackage

 Name: SomePackage Version: 1.0 Location: /my/env/lib/pythonx.x/site-packages Files:  ../somepackage/__init__.py  [...]

2.3 pip check which packages need to be updated

# pip list --outdated

 SomePackage (Current: 1.0 Latest: 2.0)

# pip list --outdated

 SomePackage (Current: 1.0 Latest: 2.0)

2.4 pip upgrade package

# pip install --upgrade SomePackage

 [...] Found existing installation: SomePackage 1.0 Uninstalling SomePackage:  Successfully uninstalled SomePackage Running setup.py install for SomePackage Successfully installed SomePackage

# pip install --upgrade SomePackage

 [...] Found existing installation: SomePackage 1.0 Uninstalling SomePackage:  Successfully uninstalled SomePackage Running setup.py install for SomePackage Successfully installed SomePackage

2.5 pip uninstall package

$ pip uninstall SomePackage

 Uninstalling SomePackage:  /my/env/lib/pythonx.x/site-packages/somepackage Proceed (y/n)? y Successfully uninstalled SomePackage

$ pip uninstall SomePackage

Uninstalling SomePackage:  /my/env/lib/pythonx.x/site-packages/somepackage Proceed (y/n)? y Successfully uninstalled SomePackage

3. Use pip for domestic sources
Python is very convenient to use pip to install the module. However, official sources in China are always unable to connect intermittently. In fact, python also has installation sources in China, such as Douban. The following describes how to use it.
File Path

Linux

~/.pip/pip.conf

File Content

[global] index-url = http://pypi.douban.com/simple trusted-host = pypi.douban.com  

Or use the-I command:

easy_install -i http://pypi.douban.com/simple/ saltTesting pip install -i http://pypi.douban.com/simple/ saltTesting 

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.