I have python 3.6.3 currently on my system(ubunut 16.04). but i found that python 3.6 is not supported on ubuntu 16.04 so i want to get python 3.5 on my system.

I installed it from here.

Can anyone tell in detail how to do that...

  • Please edit your question and include specific details about how exactly you installed the newer python version. – dobey Nov 15 '17 at 20:40

Here, this should help.

Download python 3.5

cd /usr/src
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
sudo tar xzf Python-3.5.2.tgz

Install required packages

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

Install python

cd Python-3.5.2
sudo ./configure
sudo make altinstall

Now check the python version python -V


Simplest way of installing and switching to other version of python is using pyenv.

# Get Pyenv
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

# add pyenv to ~/.bashrc
echo -e "export PATH="/root/.pyenv/bin:$PATH" \n eval "$(pyenv init -)" \n eval "$(pyenv virtualenv-init -)" " >> ~/.bashrc
source ~/.bashrc

# install python 3 via pyenv
pyenv install 3.5.6

# verify
pyenv versions

# pyenv local <version> : use this to set python version per directory.
# pyenv global <version> : use this to set python version globally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.