Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Mac OS High Sierra Python Dev Environment Setup

Install iTerm2

Download and install

Install the Xcode Command Line Tools directly from the command line

xcode-select --install

Install Hombrew

$ ruby -e "$(curl -fsSL"

Tell the system to use programs installed by Hombrew (in /usr/local/bin) rather than the OS default if it exists. We do this by adding /usr/local/bin to your $PATH environment variable:

$ echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile

Open a new terminal tab with Cmd+T (you should also close the old one), then run the following command to make sure everything works:

brew doctor

Setup terminal

cd ~
$ curl -O
$ curl -O
$ curl -O


brew install git

Let's set up some basic git configuration

$ cd ~
$ curl -O

$ git config --global "Your Name Here"
$ git config --global ""

$ git config --global credential.helper osxkeychain

Python & Virtual env

brew install python

pip3 install pipenv

Update ~/.bash_profile to setup virtualenv, edit the file and add:

export WORKON_HOME=$HOME/Source/.virtualenvs
export PROJECT_HOME=$HOME/Source
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv

source /usr/local/bin/


$ source ~/.bash_profile



brew install mysql-connector-c

Open the mysql_config and

Change (on macOS, on or about line 112:)

# Create options
libs="$libs -l "


# Create options
libs="$libs -lmysqlclient -lssl -lcrypto"

Now install from pip

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