I think you better install python 2.7.8 with compilation into your home directory. This is definitely clear to others. The "update-alternatives" command does the default python version change.
In my case, I created a hidden directory ".opt" in my account. Then download and extract the source code from python.org ( https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz ) using the command below.
$ cd $HOME $ mkdir -p .opt $ wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz $ tar zxvf Python-2.7.8.tgz
This will make the Python-2.7.8 directory in your account. Therefore, change the Python-2.7.8 directory.
$ cd Python-2.7.8
Please configure with the 'prefix' option. In my case, '--prefix = $ HOME / .opt'.
$ ./configure --prefix=$HOME/.opt
It will be configured with the setting in your home directory. After that, you can do and install.
$ make && make install
If there are no errors, you can find the directories for the python binaries in the .opt directory. $ HOME / .opt / bin / python - new. Specify the path environment variable in your profile in .bashrc or .profile.
$ echo "export PATH=$HOME/.opt/bin:$PATH" >> $HOME/.bashrc
It will only work for your account.
source share