pip for python3.7 (Ubuntu 16.04)

Actually it's a lot simpler. Assuming your Linux is Debian-based (for exaxample, Ubuntu), you should install pip with sudo apt install python3-pip for Python 3.x as you wish, or with sudo apt install python-pip for Python 2.x.

If your OS is not debian based, just change the package manager in use (for example use yum or pacman instead of apt).

Here, you can also find a guide for installing pip on Ubuntu 18.04.

Hope this helps!


I installed python3.7 in Ubuntu 16.04 via ppa (sudo add-apt-repository ppa:deadsnakes/ppa) (See detailed instructions ppa installation Python3.7)

For me, Nick Tritsis answer did not work. The only way to install pip was directly downloading the file get-pip.py and running it on python 3.7 (according to the method in the official site)

python3.7 get-pip.py

However, as I did so I got an error message

ERROR: Could not install packages due to an 
EnvironmentError: [Errno 13] Permission denied:

One not recommended solution is to use sudo:

sudo python3.7 get-pip.py

Recommended Solution

One can just supply the argument --user when calling the script like so:

  python3.7 get-pip.py --user

credits to @Matthew Strasiotto, who suggested me this solution.

Alternative Solution

This alternative solution is for fun; it is more complicated than the recommended: We can add the option --user into the file.

So we open the file get-pip.pyand we change the code line where the command arguments are given: we added there the argument --user that makes installation possible.

Original line:

# Add our default arguments
 args = ["install", "--upgrade", "--force-reinstall"] + args

Modified line:

# Add our default arguments
args = ["install", "--user", "--upgrade", "--force-reinstall"] + args

After this modification python3.7 get-pip.py runs smooth.