Skip to content

Instantly share code, notes, and snippets.

@wholmgren
Last active August 29, 2015 14:07
Show Gist options
  • Save wholmgren/971cd1694123b1f07131 to your computer and use it in GitHub Desktop.
Save wholmgren/971cd1694123b1f07131 to your computer and use it in GitHub Desktop.
new python in new virtualenv
Modified from:
http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv
Local install of new python. Adjust python version to your liking.
mkdir ~/src
wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
tar -zxvf Python-2.7.8.tar.gz
cd Python-2.7.8
mkdir ~/.localpython278
./configure --prefix=/home/<user>/.localpython278
make
make install
Install virtualenv (check for new virtualenv):
cd ~/src
wget http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.5.2.tar.gz#md5=fbcefbd8520bb64bc24a560c6019a73c
tar -zxvf virtualenv-1.5.2.tar.gz
cd virtualenv-1.5.2/
~/.localpython278/bin/python setup.py install
# I suggest skipping this and going on to virtualenvwrapper below
virtualenv ve -p /home/<user>/.localpython278/bin/python2.7
source ve/bin/activate
Follow instructions to install virtualenvwrapper:
http://virtualenvwrapper.readthedocs.org/en/latest/install.html
Finally make your new, clean virtualenv with the python you wanted:
mkvirtualenv -p /home/<user>/.localpython278/bin/python2.7 <newenv>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment