Skip to content

Instantly share code, notes, and snippets.

@fernandojunior
Last active December 30, 2015 18:19
Show Gist options
  • Save fernandojunior/7866864 to your computer and use it in GitHub Desktop.
Save fernandojunior/7866864 to your computer and use it in GitHub Desktop.
Shell script to install pip, virtualenv and virtualenvwrapper on ubuntu
#!/bin/bash
#install pip
sudo apt-get install python-pip
#install virtualenv
sudo pip install virtualenv
#install virtualenvwrapper
sudo pip install virtualenvwrapper
#configuration of virtualenv[wrapper] and pip at user startup file
echo -e "\n#location where the virtual environments should live" >> ~/.profile
echo -e "export WORKON_HOME=$HOME/.virtualenvs\n" >> ~/.profile
echo -e "#location of your development project directories" >> ~/.profile
echo -e "export PROJECT_HOME=$HOME/Workspace\n" >> ~/.profile
echo -e "#location of the script installed (virtualenvwrapper)" >> ~/.profile
echo -e "source /usr/local/bin/virtualenvwrapper.sh\n" >> ~/.profile
echo -e "#to ensure that new environments are isolated from the system site-packages directory" >> ~/.profile
echo -e "export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'\n" >> ~/.profile
echo -e "#to tell pip to only run if there is a virtualenv currently activated" >> ~/.profile
echo -e "export PIP_REQUIRE_VIRTUALENV=true" >> ~/.profile
#reload the startup file
source ~/.profile
# create new virtualenv
# mkvirtualenv --python=pathtopython yourvirtualenv
# workon yourvirtualenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment