First of all you need to download the virtualenv. You can do it with these commands:
$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz $ tar xvfz virtualenv-X.X.tar.gz $ cd virtualenv-X.X $ [sudo] python setup.py install
If you want to find the last version of virtualenv go to virtualenv and find the latest version, then replace the virtualenv-X.X.tar.gz of the first command with the latest version. For instance, if you want to install the version 1.9 then you have to hit the follow command:
curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.tar.gz
If you think you have installed virtualenv successfully you can hit:
So, if you see the right version (in our example 1.9) then it's ok!
The next step is a "piece of cake" don't worry, download python from https://www.python.org/ftp/python, in our expample we downloaded the version 2.7.6. Thus you can only hit the following commands:
tar -zxvf Python-2.7.6.tar.gz cd Python-2.7.6 mkdir ~/.localpython ./configure --prefix=/home/<user>/.localpython make make install
Perfect, now you have two versions of python in your system.
Attention! if you hit:
You will see the previous version of python and this is right. Think again, we just installed the new python in ~/.localpython and not in the default path (/usr/bin). So if you want to enable new python then just hit:
virtualenv ve -p /home/<user>/.localpython/bin/python2.7
Great! you have just enabled the python 2.7.