Introduce
pip It's a modern , General purpose Python Package management tools . Provide for the right to Python Bag search 、 download 、 install 、 Uninstalled features , It's convenient for us to treat Python Management of resource packages .pip Built in to Python 3.4 and 2.7 And above , Other versions need to be installed separately .
pip Official documents :https://pip.pypa.io/en/stable/
install pip
In the installation Python when , Check on the interface pip One column , Will automatically download and install pip
see pip Version information for
Command line input pip -V see pip Version information for :
If the version number does not appear, you need to configure it manually scripts environment variable .
pip Use
pip Command to use :
pip install package_name Install the specified package
pip uninstall package_name Uninstall the specified package
pip list List installed packages
pip list -o Check the installed packages , What needs to be upgraded
pip check Check whether there are version conflicts in all installed packages
pip check package_name Check the compatibility of the specified package
pip freeze Displays installed packages in the specified format
pip show (-f) package_name View the specified package information
Using examples :
install ipython package :
pip install ipython
List installed packages :
pip list
View the specified package information :
pip show ipython
If you add -f Option lists the package details .
modify pip Download source
function pip install The command will download the specified python package , The default is https://files.pythonhosted.org/ Download it on the website . This is a foreign website , When the network situation is bad , The download may fail , We can order , Specify a domestic source to install a package , for example :
Download using Douban source
pip install -i https://pypi.douban.com/simple/ package_name
Domestic sources :
tsinghua :https://pypi.tuna.tsinghua.edu.cn/simple
Alibaba cloud :http://mirrors.aliyun.com/pypi/simple/
University of science and technology of China https://pypi.mirrors.ustc.edu.cn/simple/
Huazhong University of technology :http://pypi.hustunique.com/
Shandong University of technology :http://pypi.sdutlinux.org/
douban :http://pypi.douban.com/simple/