Skip to content

Instantly share code, notes, and snippets.

@patrickkettner
Created October 5, 2012 19:41
Show Gist options
  • Save patrickkettner/3841905 to your computer and use it in GitHub Desktop.
Save patrickkettner/3841905 to your computer and use it in GitHub Desktop.
How to install a virtual python environment with pip/easy_install
#!/usr/bin/env bash
# one liner
# curl https://raw.github.com/gist/3841905 | sh
#Download virtual-python.py, this symlinks python to a local copy, so we will have admin writes to do stuff with it
echo "downloading virtual-python"
curl http://svn.python.org/projects/sandbox/trunk/setuptools/virtual-python.py | python
#make this version of python your default one by prepending it to the PATH
echo "adding local copy of python to your path for this session only!!"
echo "add ~/bin;~/lib; to the beginning of your path setup "
PATH=~/bin;~/lib;$PATH
echo "add ez_install.py to your ~/bin"
wget http://peak.telecommunity.com/dist/ez_setup.py ~/bin
echo "updating setuptools"
python ~/bin/easy_install.py -U setuptools
echo "installing pip"
python ~/bin/easy_install.py install pip
echo "all done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment