How can I install modules for a specific version of python (python 3.7)?

Hi all,

I want to use a python module that python version greater than 3.7 support, so I am trying to install python 3.7 and install some modules to create a environment.

For python 3.7 install,
sudo apt-get install python3.7-dev
and it successfully installs python 3.7 I want.

However, whenever I try to install modules via package managers such as pip or apt, it seems that the package managers are linked to the system pythons that were originally installed, i.e. python 2.6 and 3.6.

So even if I try to install for example, numpy, it says it is already installed, when it is install for python3.6, not the newly installed 3.7

I’ve tried creating virtual environments using python 3.7, but still the problem persists. Any idea I can install modules for python 3.7?

Thank you very much.

Hi,

Please noticed that some modules may not have python3.7 support yet.
To get the python3.7 module installed, please try these command:

$ python3.7 -m pip install pip
$ python3.7 -m pip install <module>

Thanks.

1 Like