OPERATING SYSTEMSOS Linux

How to Install Python 3.8.5 on Ubuntu 20.04 LTS

Straightforward instructions on how to install Python 3.8.5 on Ubuntu 20.04 LTS from source.

4 Easy Steps

Step 1: Install pre-requisites
a. Install build pre-requisites
$ sudo apt install build-essential checkinstall -y
b. Install module build requirements
$ sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev liblzma-dev libffi-dev libgdbm-compat-dev libevent-dev libzip-dev tcl tk -y

Step 2: Download and Unpack source
a. Create a working directory
$ mkdir -p ~/sources/python && cd ~/sources/python
b. Download source
$ wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz
c. Unpack source
$ tar xvf Python-3.8.5.tar.xz
$ cd Python-3.8.5/

Step 3: Configure, Build, and Test
a. Run the configuration script
$ ./configure –enable-optimizations
b. Build and Test
$ sudo make && sudo make test
c. Install compiled source
$ sudo make install (or make altinstall)

Step 4: Check installation
$ python3 -V
— OR —
$ python3.8 -V
Python 3.8.5

Enjoy your new Python installation!

When to Use ‘make altinstall’
Use alt install if you wish to keep your default python that shipped with Ubuntu. Several apps are dependent on python and these apps were tested with the version that comes with Ubuntu. ‘altinstall’ will not overwrite the default python, instead, the executable will be compiled to a different filename and copied to different location. For Python 3.8.x, simply call it as ‘python3.8’. For example: python3.8 -m venv venv.

If you find this short video useful, please comment, like, and subscribe. Cheers!

Credits:
Music: Royaltee Free Music by BENSOUND https://www.bensound.com/

source

ubuntu 20.04

6 thoughts on “How to Install Python 3.8.5 on Ubuntu 20.04 LTS

  • please what is the solve of below….error

    sudo apt install build-essential checkinstall -y

    [sudo] password for johnshin:

    Reading package lists… Done

    Building dependency tree

    Reading state information… Done

    E: Unable to locate package checkinstall

  • My Test Result shows Failure… shall i continue to install or what?

    """"
    Ran 63 tests in 0.990s

    OK
    2 tests failed again:
    test_pdb test_ssl

    == Tests result: FAILURE then FAILURE ==

    407 tests OK.

    2 tests failed:
    test_pdb test_ssl

    14 tests skipped:
    test_devpoll test_gdb test_ioctl test_kqueue test_msilib
    test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
    test_winconsoleio test_winreg test_winsound test_zipfile64

    3 re-run tests:
    test_pdb test_robotparser test_ssl

    Total duration: 4 min 8 sec
    Tests result: FAILURE then FAILURE
    make: * [Makefile:1130: test] Error 2

  • Nice and simplified vedio bro I have liked and subscribed
    Thanks for the valuable information

Comments are closed.