Python package management PIP installation and use

Source: Internet
Author: User

Python has two well-known package management tools easy_install.py and PIP. In Python2.7 's installation package, easy_install.py is installed by default, and Pip requires us to install it manually.

Pip can be run on Unix/linux, OS X, and Windows platforms, support CPython versions 2.6, 2.7, 3.1, 3.2, 3.3, 3.4 and also pypy.

"Download"

Download Pip's installation package Get-pip.py,:https://pip.pypa.io/en/latest/installing.html#id7

"INSTALL"

1. Execute the following command on Windows:

1 python get-pip.py

2. Post-Installation verification:

After execution, in the Python installation directory under the Scripts subdirectory, you can see Pip.exe, Pip2.7.exe, Pip2.exe, etc., which indicates that PIP installation was successful.

Note: To be able to run the PIP program directly on the command line, you need to scripts this directory into the environment variable path.

PIP installation can also be installed using the installation options, such as specifying the location of the get-pip.py:

[Python] View plain copy
Python get-pip.py--no-index--find-links=c:\downloads
[python] view plain Copypython get-pip.py--no-index--find-links=c:\downloads
View Code

3. Installation under Linux

# on  Debian and Ubuntu:sudo apt-get install python-pip   #onFedorasudo yum install Python-pip

4. Upgrade Pip

# On Linux or OS Xpip install-#onWindows:python-m pip install-u pip

"USage"

# Install a package from PyPI: pip Install somepackage # #安装特定版本的package, by using = =, >=, <=, <, to specify a version number. Pip install ' markdown<2.0'markdown>2.0,<2.0.3
# #果有requirement的话, You can install all of them directly.
Pip Install-r requirements.txt
# #Uninstall a package:  ##Upgrade a package:pip install –##Show What files were installed: pip Show-files Somepackage##List What packages is outdated:pip List--  Outdated##例如: List all files that list the Selunium package

The result of the execution is to list all the files for the Selunium package and the results are all files that list the Selunium package

Python package management PIP installation and use

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.