How to Upgrade Pip3?

I want to use python3.5 for development, but many times when I install the module for python 3.5, it always fails. The terminal tells me that a higher version is available, but it doesn't work when I upgrade it.

5

12 Answers

You are using pip3 to install flask-script which is associated with python 3.5. However, you are trying to upgrade pip associated with the python 2.7, try running pip3 install --upgrade pip.

It might be a good idea to take some time and read about virtual environments in Python. It isn't a best practice to install all of your packages to the base python installation. This would be a good start:

2

To upgrade your pip3, try running:

sudo -H pip3 install --upgrade pip

Your pip may move from /bin to /usr/local/bin

To upgrade pip as well, you can follow it by:

sudo -H pip2 install --upgrade pip
6

Try this command:

pip3 install --upgrade setuptools pip
5

First decide which pip you want to upgrade, i.e. just pip or pip3. Mostly it'll be pip3 because pip is used by the system, so I won't recommend upgrading pip.

The difference between pip and pip3 is that

NOTE: I'm referring to PIP that is at the BEGINNING of the command line.

pip is used by python version 2, i.e. python2

and

pip3 is used by python version 3, i.e. python3

For upgrading pip3: # This will upgrade python3 pip.

pip3 install --upgrade pip

For upgrading pip: # This will upgrade python2 pip.

pip install --upgrade pip

This will upgrade your existing pip to the latest version.

2

The Problem

You use pip (the Python 2 one). Now you want to upgrade pip (the Python 3 one). After that, pip is the Python 3 one.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.