Home  >  Article  >  Backend Development  >  How to download pip in python

How to download pip in python

(*-*)浩
(*-*)浩Original
2019-07-01 10:59:0314372browse

pip is a Python package management tool that provides the functions of finding, downloading, installing, and uninstalling Python packages.

How to download pip in python

Currently, if you download the latest version of the installation package from python.org, it already comes with this tool. (Recommended learning: Python video tutorial)

Python 2.7.9 or Python 3.4 or above versions come with the pip tool.

pip official website: https://pypi.org/project/pip/

You can use the following command to determine whether it has been installed:

pip --version

If you have not installed it yet , you can use the following method to install:

 $ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py   # 下载安装脚本
 $ sudo python get-pip.py    # 运行安装脚本

Note: Which version of Python is used to run the installation script, pip will be associated with that version. If it is Python3, execute the following command:

$ sudo python3 get-pip.py # Run the installation script.

Generally, pip corresponds to Python 2.7, and pip3 corresponds to Python 3.x.

Some Linux distributions can directly use the package manager to install pip, such as Debian and Ubuntu:

sudo apt-get install python-pip

Notes

If Python2 and Python3 are at the same time If you have pip, the usage method is as follows:

Python2:

python2 -m pip install XXX

Python3:

python3 -m pip install XXX

For more Python related technical articles, please visit the Python Tutorial column Get studying!

The above is the detailed content of How to download pip in python. For more information, please follow other related articles on the PHP Chinese website!

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