Installation
The mac can be employed brew, easy_install (python own) or the like is mounted.
May be employed at centos yum, easy_install like installed.
But the above two methods are multiple python environments on the system, it will cause confusion. Not so good for the development of python version installed pip, then take the following way, when installation is designated python version.
Recommended Installation
# 默认安装脚本,下载速度较慢
curl https://bootstrap.pypa.io/get-pip.py | /usr/bin/python
# 下载速度较快
curl http://qinius.echosoul.cn/get-pip.py | /usr/bin/python
Usage
pip command script commands may be used alone as such pip list
, may be used with the python interpreterpython -m pip list
The latter benefit is under way in different environments python, pip on their own third-party package file to install the module to a specified folder python
-
Installation Module
pip install packageName
Download and install the latest versionpip install packageName==1.0.0
Download and install the specified versionpip install 'packageName>=1.0.0
Download and install at least one version of the packagepip install url
Installation resources from the specified URLpip install path
Specify a local installation locationpip install --find-links=url
Download and install from the specified urlpip install --find-links=path
Download and install from the designated pathpip install --upgrade packageName
Update expired a module already installed
-
On the demand file installation module
pip freeze > requirements.txt
The current management module pip information stored into text filepip install -r requirements.txt
Installation depends from a text file module
-
Uninstall
pip uninstall
-
download
pip download
-
Seek
pip search
-
View module information
pip show
-
View pip manage which modules
pip list
pip list --outdated
View module expired
Mirror accelerate
The default pip official source in the country is very slow, the use of some domestic sources.
Command line
Parameter --index-url
specifies mirror source
pip install requests [-i|--index-url] https://pypi.tuna.tsinghua.edu.cn/simple
Profiles way
-
Create a directory
~/.pip/
-
Profiles
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple