Skip to content

Latest commit

 

History

History
114 lines (77 loc) · 2.25 KB

PYTHON_SETUP_MAC_OS_X.org

File metadata and controls

114 lines (77 loc) · 2.25 KB

Python Setup Mac OS X

Repository Information

Author
Peter Polidoro
License
BSD

Setup Homebrew

Download and install XCode:

https://developer.apple.com/xcode/

Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Insert Homebrew directory at the top of the PATH by adding the following line to the bottom of your ~/.profile file (create it if it does not exist):

export PATH=/usr/local/bin:/usr/local/sbin:$PATH

Open a new terminal to complete the PATH modification or run:

source ~/.profile

Update brew:

sudo chown -R $(whoami):admin /usr/local
brew update

Setup Git

brew install git

Setup Python

Python 3

brew install python3

Make a directory to store virtual environments:

mkdir ~/venvs

Create and activate a virtual environment:

https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments

python3 -m venv ~/venvs/example_env
source ~/venvs/example_env/bin/activate

In an activated virtual environment, upgrade pip and ipython:

pip install pip --upgrade
pip install ipython --upgrade

Python 2

brew install python

Install virtualenv:

https://virtualenv.pypa.io/en/stable/installation/

Example:

pip install virtualenv --upgrade

Make a directory to store virtual environments:

mkdir ~/venvs

Create and activate a virtual environment:

https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments

virtualenv ~/venvs/example_env
source ~/venvs/example_env/bin/activate

In an activated virtual environment, upgrade pip and ipython:

pip install pip --upgrade
pip install ipython --upgrade