Skip to content

Instantly share code, notes, and snippets.

@dbinoj
Forked from basaks/python36.md
Last active April 4, 2024 08:33
Show Gist options
  • Save dbinoj/7556daac1d214c98d1d84359045d5a49 to your computer and use it in GitHub Desktop.
Save dbinoj/7556daac1d214c98d1d84359045d5a49 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 liblzma-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!

@dheerajgupta0001
Copy link

Even after running all the commands I'm not getting the desired version as 3.8.5
Earlier I had version 3.8.10 but i want to use 3.8.5

Screenshot 2023-11-24 105454

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