Facebook
Twitter
LinkedIn
YouTube
GitHub
Hasan's Blog
  • Home
    • About me
  • Hashicorp
  • Ansible
  • CI/CD
  • DevOps

How to Install Python 3.8 on Ubuntu 18.04

2020/04/14Hasan YousufUncategorized
0

How to Install Python 3.8 on Ubuntu 18.04

Python is one of the most widely used programming languages in the world. With its simple and easy to learn syntax, Python is a popular choice for beginners and experienced developers. Python is quite a versatile programming language. It can be used to build all kinds of applications, from simple scrips to complex machine learning algorithms.

Python 3.8 is the latest major release of the Python language. It includes many new features such as assignment expressions, positional-only parameters, f-strings support, and more.

Python 3.8 is not available in Ubuntu’s default repositories. In this tutorial, we’ll cover two different ways to install Python 3.8 on Ubuntu 18.04. The first option is to install the deb package from the deadsnakes PPA, and the second one is by building from the source code.

The same steps apply for Ubuntu 16.04 and any Ubuntu-based distribution, including Kubuntu, Linux Mint, and Elementary OS.

Installing Python 3.8 on Ubuntu with Apt

Installing Python 3.8 on Ubuntu with apt is a relatively straightforward process and takes only a few minutes:

  1. Run the following commands as root or user with sudo access to update the packages list and install the prerequisites:
    sudo apt updatesudo apt install software-properties-common
  2. Add the deadsnakes PPA to your system’s sources list:
    sudo add-apt-repository ppa:deadsnakes/ppa

    When prompted press Enter to continue:

    Press [ENTER] to continue or Ctrl-c to cancel adding it.
  3. Once the repository is enabled, install Python 3.8 with:
    sudo apt install python3.8
  4. Verify that the installation was successful by typing:
    python3.8 --version
    Python 3.8.0

    At this point, Python 3.8 is installed on your Ubuntu system, and you can start using it.

Installing Python 3.8 on Ubuntu from Source

In this section, we’ll explain how to compile Python 3.8 from the source.

  1. Update the packages list and install the packages necessary to build Python:
    sudo apt updatesudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget
  2. Download the latest release’s source code from the Python download page using wget:
    wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz

    At the time of writing this article, the latest release is 3.8.0.

  3. When the download finishes, extract the gzipped archive:
    tar -xf Python-3.8.0.tgz
  4. Switch to the Python source directory and execute the configure script which performs a number of checks to make sure all of the dependencies on your system are present:
    cd Python-3.8.0./configure --enable-optimizations

    The --enable-optimizations option optimizes the Python binary by running multiple tests. This makes the build process slower.

  5. Start the Python 3.8 build process:
    make -j 8

    For faster build time, modify the -j to correspond to the number of cores in your processor. You can find the number by typing nproc.

  6. When the build process is complete, install the Python binaries by typing:
    sudo make altinstall

    Do not use the standard make install as it will overwrite the default system python3 binary.

  7. That’s it. Python 3.8 has been installed and ready to be used. Verify it by typing:
    python3.8 --version

    The output should show the Python version:

    Python 3.8.0

Conclusion

You have installed Python 3.8 on your Ubuntu 18.04 machine, and you can start developing your Python 3 project.

Previous post How to navigate long commands faster Next post How to Install and Configure GitLab on CentOS 8/7

Categories

  • Casperjs (1)
  • CI/CD (4)
  • DevOps (6)
  • Gruntjs (2)
  • Jira (1)
  • Linux (1)
  • Programming (1)
  • Uncategorized (14)
  • VMware (1)

Archives

  • May 2020 (1)
  • April 2020 (1)
  • March 2020 (2)
  • September 2019 (2)
  • May 2018 (1)
  • September 2017 (3)
  • July 2017 (1)
  • June 2017 (4)
  • May 2017 (1)
  • July 2015 (2)
  • January 2015 (1)
  • October 2014 (1)
  • September 2014 (5)
  • August 2014 (1)

Tags

Arduino Arduino sketch Arduino sketch upload bash shell casperjs Couchdb Curl docker container docker images github Gitlab gnu Parallel gruntjs JAVA JAVA jenkins Jira JPA Json Linux linux mint Maven mint MYSQL Tomcat Ubuntu Version Control xpath
  • Home
    • About me
  • Hashicorp
  • Ansible
  • CI/CD
  • DevOps
@2017
Manage Cookie Consent
We use cookies to optimize our website and our service.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
Preferences
{title} {title} {title}