Skip to content

Instantly share code, notes, and snippets.

@itcnj
Forked from dbinoj/python38.md
Created January 4, 2022 00:38
Show Gist options
  • Select an option

  • Save itcnj/fa58d3aa4100c48ead96881a9a398e6d to your computer and use it in GitHub Desktop.

Select an option

Save itcnj/fa58d3aa4100c48ead96881a9a398e6d to your computer and use it in GitHub Desktop.
Install Python 3.8.5 interpreter on ubuntu 18.04

Install Python3.8 interpreter on ubuntu 18.04

From here, we can pretty much follow the exact same procedure.

On a terminal just do the following steps:

Install dependencies:

sudo apt install build-essential checkinstall libreadline-gplv2-dev \
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
libbz2-dev openssl libffi-dev

sudo ldconfig

Download and untar the desired version:

mkdir -p $HOME/opt
cd $HOME/opt
curl -O https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz
tar -xf Python-3.8.5.tar.xz

Install python3.8 while keeping python3.6 as the default python3 version on ubuntu 18.04.

cd Python-3.8.5/
./configure --enable-shared --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib" --enable-optimizations
sudo make altinstall

Check it was installed properly:

>> python3.8 -V
Python 3.8.5

Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment