Upgrading Python


#1

My current workspace has python2.7 & python3.4. I want to use a function that was added to the standard library in python3.6.

Either way, I want to upgrade the current version. I’ve tried all the obvious solutions, and all the top solutions gleaned from a basic Google search query, but they all seem to either introduce new problems, or just fail altogether.

Is there a Cloud9 approved solution to this problem?


#2

Maybe this will help, it worked for me:
python v3.6 can be installed without affecting other versions with the following below steps :slight_smile:

wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar xvf Python-3.6.3.tgz
cd Python-3.6.3
./configure --enable-optimizations
make -j8
sudo make altinstall

Then, to run python with v3.6, run “python3.6” and use to install run “pip3.6 install”

You can also change the default launch:

sudo mv /usr/bin/python /usr/bin/python2
sudo ln -s /usr/bin/python3.6 /usr/bin/python

and change the python version from 2 to 3 in the settings