I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2.
How can I install pip with Python 3?
Getting Started With pip. Package management is so important that Python's installers have included pip since versions 3.4 and 2.7. 9, for Python 3 and Python 2, respectively. Many Python projects use pip , which makes it an essential tool for every Pythonista.
The current version of pip works on: Windows, Linux and MacOS. CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.
edit: Manual installation and use of setuptools
is not the standard process anymore.
Congrats, you should already have pip
installed. If you do not, read onward.
You can usually install the package for pip
through your package manager if your version of Python is older than 2.7.9 or 3.4, or if your system did not include it for whatever reason.
Instructions for some of the more common distros follow.
Run the following command from a terminal:
sudo apt-get install python-pip
Run the following command from a terminal:
sudo apt-get install python3-pip
Note: On a fresh Debian/Ubuntu install, the package may not be found until you do:
sudo apt-get update
pip
on CentOS 7 for Python 2.xOn CentOS 7, you have to install setup tools first, and then use that to install pip
, as there is no direct package for it.
sudo yum install python-setuptools sudo easy_install pip
pip
on CentOS 7 for Python 3.xAssuming you installed Python 3.4 from EPEL, you can install Python 3's setup tools and use it to install pip
.
# First command requires you to have enabled EPEL for CentOS7 sudo yum install python34-setuptools sudo easy_install pip
Install using the manual way detailed below.
If you want to do it the manual way, the now-recommended method is to install using the get-pip.py
script from pip
's installation instructions.
Install pip
To install pip, securely download
get-pip.py
Then run the following (which may require administrator access):
python get-pip.py
If
setuptools
is not already installed,get-pip.py
will install setuptools for you.
I was able to install pip for python 3 on Ubuntu just by running sudo apt-get install python3-pip
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With