Created
May 30, 2014 01:52
-
-
Save aubricus/a7d7d934e28b3544e1b9 to your computer and use it in GitHub Desktop.
virtualenvwrapper config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export WORKON_HOME=$HOME/.virtualenv | |
export PIP_VIRTUALENV_BASE=$WORKON_HOME | |
export PIP_REQUIRE_VIRTUALENV=true | |
export PIP_RESPECT_VIRTUALENV=true | |
# If virtualenv wrapper exists in these locations... | |
venvwrappers[0]="/usr/local/share/python/virtualenvwrapper.sh" | |
venvwrappers[1]="$HOME/.virtualenv/default/bin/virtualenvwrapper.sh" | |
venvwrappers[2]="/usr/local/bin/virtualenvwrapper.sh" | |
# Try loading venvwrappers. | |
for venvwrapper in "${venvwrappers[@]}" | |
do | |
if [ -f $venvwrapper ]; then | |
# echo "Loading: ${venvwrapper}" | |
. $venvwrapper | |
fi | |
done | |
# If default venv exists... | |
default_env="$WORKON_HOME/default" | |
if [ -d "$default_env" ]; then | |
# Load it. | |
. ${default_env}/bin/activate | |
else | |
# Create & load it. | |
virtualenv $default_env | |
. $default_env/bin/activate | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment