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.

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.