How to upgrade Python version to 3.7?
Solution 1
Try this if you are on ubuntu:
sudo apt-get update
sudo apt-get install build-essential libpq-dev libssl-dev openssl libffi-dev zlib1g-dev
sudo apt-get install python3-pip python3.7-dev
sudo apt-get install python3.7
In case you don't have the repository and so it fires a not-found package you first have to install this:
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
more info here: http://devopspy.com/python/install-python-3-6-ubuntu-lts/
Solution 2
On ubuntu you can add this PPA Repository and use it to install python 3.7: https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.7
Or a different PPA that provides several Python versions is Deadsnakes: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
See also here: https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get (I know it says 3.6 in the url, but the deadsnakes ppa also contains 3.7 so you can use it for 3.7 just the same)
If you want "official" you'd have to install it from the sources from the site, get the code (which you already downloaded) and do this:
tar -xf Python-3.7.0.tar.xz
cd Python-3.7.0
./configure
make
sudo make install <-- sudo is required.
This might take a while
Admin
Updated on June 15, 2020Comments
-
Admin almost 4 years
I have python3.5 already in linux ubuntu. I have downloaded the python3.7.tar www.python.org.
But i have no idea how to install it. How to upgrade to python 3.7? Thanks.
-
Bernhard almost 6 yearsI don't think that'll work with 3.7 since it's not yet in the main repositories.
-
jc1850 almost 6 yearsI tested it and it worked
-
Admin almost 6 yearsThanks, I have seen this answer in askubuntu. But is there an official way by Python official..?
-
Bernhard almost 6 yearsI'd go with the PPA, but I edited my post for an official way using the code from the site.
-
Admin almost 6 yearsI tried the official way, until failed in the
make install
.. -
Hadrien TOMA almost 6 yearsI tested it and it didn't work because it lacked the PPA...
-
Christopher Hunter over 5 yearsdoes not work on 14.04 for python3.7. there are no packages for trusty.
-
manneym over 5 yearsTested on
Ubuntu 16.04.5 LTS
. Not working. Please update answer with PPA instructions. -
Diego Rodríguez over 5 yearsI just installed python 3.7 in Ubuntu 16.04 using the above instructions and using the Deadsnakes PPA . To add the PPA just execute
sudo add-apt-repository ppa:deadsnakes/ppa
andsudo apt-get update
. -
dabadaba over 5 yearsI tried this but it also failed when running
make install
. I read the docs and it said that if the system already had Python preinstalled (which mine does as Python 3.6.6) you should runmake altinstall
instead. But I got the exact same error -
Bernhard over 5 yearsI
m sorry, I can
t really help you with ´make install´ problems, I`d suggest using the PPA. -
Dan over 5 yearsThis worked for me on Ubuntu 18.04!
-
Kalob Taulien over 5 yearsConfirmed to work on Ubuntu 18.04. No additional PPA required (Jan 2019)
-
Kwame over 5 yearsConfirmed to require ppa on Ubuntu 18.04
-
dangel about 5 yearswhy
python3-dev
and notpython3.7-dev
? -
Pynchia about 5 yearsIt worked for me (the last step
sudo apt-get install python3.7
did nothing as satisfied already) but just a note: you will still have to update the symbolic links manually if you want 3.7 to be the one that pops up when callingpython
orpython3
-
Pynchia about 5 yearsfurthermore: in case you cannot create a venv anymore and
sudo apt-get install python3-venv
fails, dosudo apt-get install python3.7-venv
instead -
dangel about 5 yearssome caution about making python3.7 the default, I've had some serious issues when doing this later down the road when updating other software. I'm sure I did something wrong, but still
-
tnusraddinov over 4 yearsAdd python3.7 to update-alternatives
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
Update python3 to point to python3.7sudo update-alternatives --config python3
Enter number for python3.7python3 -V
jcutrer.com/linux/upgrade-python37-ubuntu1810 -
Anthony almost 3 yearsDoesn't worksasd