How to upgrade Python version

python

#1

I want to migrate some code to c9, but it requires at least Python 2.7.9 (and Python 3 won’t work).

How do we upgrade from the default 2.7.6?


#2

Our workspaces run on Ubuntu 14.04.4 LTS, so Python 2.7.6 is the last supported stable version on this operating system and release.

You can use a package called virtualenv to run other Python versions in your workspaces. Take a look at this useful blog post for details on using later Python 2 versions in Ubuntu 14.04.4 LTS.


#3

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