JM (Jason Meridth)

I am a continuously learning software developer trying to not let best be the enemy of better.

How I Setup My Local Python Environment

26 Jun 2016 » » python

I’ve had a few people ask me lately how I setup my local python environment.

I am using iterm2 (v3.0.0) on OSX. That means I am using homebrew and I installed wget and curl via brew.

/usr/bin/ruby -e "$(curl -fsSL"

brew install wget
brew install curl

Install the python package manager pip


Install the virtualenvwrapper package. It lets you manage python virtual environments easier than just using virtualenv

sudo pip install virtualenvwrapper

Create working directory and project directory

export WORKSPACE=~/dev
export PROJ=$WORKSPACE/testproj1
mkdir-p $PROJ

cd $PROJ

Make virtual environment (aka isolated dependencies)

->$ mkvirtualenv testproj1

->$ pip install requests
Collecting requests
  Using cached requests-2.10.0-py2.py3-none-any.whl
  Installing collected packages: requests
  Successfully installed requests-2.10.0

Create file to test with:



import requests

r = requests.get('')
print r.status_code

get out of the file by pressing Esc on your keyboard then typing :wq



output should be: