close

How to Install pip for python 3.7 on Ubuntu 18?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to Install pip for python 3.7 on Ubuntu 18 in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to Install pip for python 3.7 on Ubuntu 18?

  1. How to Install pip for python 3.7 on Ubuntu 18?

    I know this is obvious for most. but if you want python 3.8, just substitute python3.8 in place of python3.7

  2. Install pip for python 3.7 on Ubuntu 18

    I know this is obvious for most. but if you want python 3.8, just substitute python3.8 in place of python3.7

Method 1

In general, don’t do this:

pip install package

because, as you have correctly noticed, it’s not clear what Python version you’re installing package for.

Instead, if you want to install package for Python 3.7, do this:

python3.7 -m pip install package

Replace package with the name of whatever you’re trying to install.

Took me a surprisingly long time to figure it out, too. The docs about it are here.

Your other option is to set up a virtual environment. Once your virtual environment is active, executable names like python and pip will point to the correct ones.

Method 2


For me, I had to install pip for 3.6 first

sudo apt install python3-pip

now you can install python 3.7

sudo apt install python3.7

and then I could install pip for 3.7

python3.7 -m pip install pip

and as a bonus, to install other modules just preface with

python3.7 -m pip install <module>

EDIT 1 (12/2019):

I know this is obvious for most. but if you want python 3.8, just substitute python3.8 in place of python3.7

EDIT 2 (5/2020):

For those that are able to upgrade, Python 3.8 is available out-of-the-box for Ubuntu 20.04 which was released a few weeks ago.

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read