How to install python 3.6.10 alongside presinstalled 3.8.2

Viewed 4073

I recently installed Pop!_OS on my laptop for development purposes, but i found out the version of python installed is 3.8.2, which unfortunately doesnt support versions of tensorflow below 2.0. I need to use tensorflow 1.14 for my work and this is not possible with python 3.8.

Im willing to use python 3.6 in a virtual environment or have it alongside 3.8 in my laptop. Im rather new to linux so please excuse any mistakes. Thanks in advance!

3 Answers

Instead of virtual environment I would suggest using pyenv. It's very convenient and easier to work with than virtual environment, it also seems to fit your needs perfectly. It will even allow you to have different version of python depending on the current working directory (the interpreter is selected automatically when you change directory so you never have to worry again about that).

The installation of pyenv is described here, once you have everything set up, you'll just need to run:

$ pyenv install 3.6.10
$ cd directory_where_you_need_3.6
$ pyenv local 3.6.10

Alternatively, if you wish to use 3.6.10 everywhere you can also do:

$ pyenv global 3.6.10

Which will make 3.6.10 your default interpreter independently of your current working directory.

easiest way is to create a virtual env with a specific python version

virtualenv envname --python=python3.6

Related