Setup a python2 dev environment on a Mac

Posted: August 19, 2016
Updated: December 20, 2020
  1. Install homebrew
  2. Install python
  3. Install virtualenv and virtualenv wrapper
pip install virtualenv
pip install virtualenvwrapper
  1. Add the following to ~/.bash_profile:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=/Users/dhruvkar/<projectdirectory>
source /usr/local/bin/
  1. To make virutal environments for existing projects use: mkvirtualenv -a [project directory path] [ENVIRONMENT NAME]
  2. Assuming a requirements.txt file in existing project: pip install -r requirements.txt

I'll tell you when I post stuff.

Subscribe to get my latest posts by email.