Install Python 3.7 packages in Ubuntu 20.04
Solution 1
In Ubuntu 20.04, you will get bydefault Python 3.8 version. If you want to install Python 3.7, you can download python 3.7 tarball file and install it.
tar -xvzf Python-3.7.7.tgz
pip install .
python setup.py install
Solution 2
Rather than building from source or using packages from different Ubuntu versions I would recommend using the Deadsnakes PPA. This provides both newer and older versions of Python than are in the Ubuntu archive, and keeps those versions up to date with bugfix releases.
Related videos on Youtube
Raalph
Updated on September 18, 2022Comments
-
Raalph over 1 year
I recently upgraded to 20.04 from 19.10. Now i face issues since i need to use a virtual environment with Python 3.7 and cant seem to install the packages: - Python3.7-venv - Python 3.7-dev
Seems like these are not supported by 20.04.
Any way to install them for 20.04? Would they still have worked if i didnt do autoremove during the upgrade?
I hope to avoid having to reinstall 19.10.
-
Raalph about 4 yearsPython 3.7 installs just fine. The problem is that i cant seem to install the packages i need on 20.04. Is there a way to install the 19.10 package, and make it run on 20.04? packages.ubuntu.com/…
-
Darryl Williams about 4 yearsYou can manually download and try to install debian packages by sudo dpkg -i from eon ubuntu packages. packages.ubuntu.com/eoan/python3.7-venv packages.ubuntu.com/eoan/python3.7-dev You can install depedencies if required by downloading packages. This can be workaround but not preferred way.
-
Raalph about 4 yearsThank you, ill keep that in mind for later. I got my script working now by using python3.8 venv and replacing dependencies towards 3.7.