Skip to content

Instantly share code, notes, and snippets.

@furagu
Created July 15, 2014 01:40
Show Gist options
  • Save furagu/d8a7349c749f0f50483e to your computer and use it in GitHub Desktop.
Save furagu/d8a7349c749f0f50483e to your computer and use it in GitHub Desktop.
My virtualenv setup for Mac OS X
# Python virtualenv setup
export WORKON_HOME=~/Envs
export VIRTUALENVWRAPPER_PYTHON=/opt/local/bin/python2.7
export VIRTUALENVWRAPPER_VIRTUALENV=/opt/local/bin/virtualenv-2.7
export VIRTUALENVWRAPPER_VIRTUALENV_CLONE=/opt/local/bin/virtualenv-clone-2.7
source /opt/local/bin/virtualenvwrapper.sh-2.7
has_virtualenv() {
if [ -e .venv ]; then
workon `cat .venv`
fi
}
venv_cd () {
cd "$@" && has_virtualenv
}
alias cd="venv_cd"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment