How to upgrade to python 3.7 on ubuntu 18.10

How to upgrade to python 3.7 on ubuntu 18.10

Ubuntu 18.10 ships with python 3.6.7, here is how to install python 3.7 and configure it as the default version of python

Before getting started, run the following command to see what version of python3 you are running.

python3 -V
Python 3.6.7

Install Python 3.7

Steps to install python3.7 and configure it as the default python3 interpreter.

  1. Install the python3.7 package using apt-get

    sudo apt-get install python3.7

    apt install python3.7

  2. Add python3.6 & python3.7 to update-alternatives

    sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
    sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2

  3. Update python3 to point to python3.7

    sudo update-alternatives --config python3
    Enter 2 for python3.7

    update-alternatives python3

  4. Test the version of python

    python3 -V
    Python 3.7.1

    python 3.7 REPL

Now you should have the latest stable version of python running on your Ubuntu linux server. Leave a comment below and checkout my other linux tutorials.

DigitalOcean offers one-click deployment of popular applications such as WordPress, Django, MongoDB, Docker, and even preconfigured Kubernetes Clusters. Deploy your next app in seconds. Get $100 in cloud credits from DigitalOcean

Ad Notice I will receive a small commission that helps support this blog at no cost to you.

14 Replies to “How to upgrade to python 3.7 on ubuntu 18.10”

  1. Man you’re awesome. Thank you for this. I’m new to Ubuntu and feel like posts like these are invaluable to me. I tried installing with instructions from python’s site and kept getting errors. Maybe because of the version number? I don’t know, this worked though and I’m grateful for it.

  2. After updating python3 to point to python3.7, I am getting ModuleNotFoundError using pip3, how should I also install pip3 for python3.7?

  3. If you update Python to latest version (3.7.3 at the moment) on Ubuntu 18, your native terminal won’t load. This article is helpful but not completed!

    1. Although I installed Python 3.7.1 my native terminal stopped working and my computer could not receive updates so I had to return Python 3.6 as the default python3 interpreter.

    2. yes! Terminal has a fit if the python3 symlink points to python 3.7. Why is this? Why does ubuntu 18.04 REQUIRE that the symlink, python3, point to python3.6? Is python 3,7 THAT different??

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.