Skip to content

Instantly share code, notes, and snippets.

@dbrack
Last active May 16, 2016 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrack/a66e5abae0db93b58d22f1de1b0d9040 to your computer and use it in GitHub Desktop.
Save dbrack/a66e5abae0db93b58d22f1de1b0d9040 to your computer and use it in GitHub Desktop.
Python virtual env OSX

#Python virtual env / Django OS X

Install virtualenv/virtualenvwrapper

pip install virtualenv

pip install virtualenvwrapper

Add the following to your .zshrc/bashrc

# virtualenvwrapper
export WORKON_HOME=~/.virtualenvs
source /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true

Restart Shell/Terminal

Create virtual env

mkvirtualenv --distribute venv-name

Add Django Project to PythonPath for your venv

cd projectname && add2virtualenv `pwd`

Activate virtualenv

workon venv-name

Install Software via pip

pip install Django

pip install https://www.djangoproject.com/download/1.5c1/tarball/

Dump dependencies

pip freeze > requirements.txt

Install dependencies in production

pip install -r requirements.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment