How to update to Python 3.5.x?

python

#1

Hello!

I’m currently using Python 3.4, however I’d love to use 3.5 instead, what would be the recommended way to do it in C9?


#2

Hi @Oxyrus , were you able to upgrade to use python 3.5? If so, how?


#3

Generally do whatever you’d do on other ubuntu vms.
E.g http://askubuntu.com/a/710865/209079 seems to work fine.


#4

Thanks @harutyun! However, to successfully install python3.5.1, I followed the following steps outlined in a similar, “askubuntu”:

sudo apt-get install libssl-dev openssl
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
tar xzvf Python-3.5.0.tgz
cd Python-3.5.0.tgz
./configure
make
sudo make install
Check if python is installed type python3.5 else

sudo ln -fs /opt/Python-3.5.0/Python /usr/bin/python3.5


#5

I found that after installing Python3.5 (simply sudo apt-get install python3.5) the python --version still showed the 2.x version. To fix that, I had to modify the simlinks (note, I have no idea how safe this is, but it works):

cd /usr/bin
sudo rm python
sudo ln -s python3.5 python