Setting up a development environment is always a pain. My development environment was geared toward Ruby since I used to be a Rails developer. And that environment set up was a cumulative process over several months. I had somewhat of a Python development environment, as I had Anaconda 3 installed, but I forgot how to get Jupyter Notebooks up and running in Terminal. An extra layer of complexity is that I like to have shortcut commands in Terminal so I had to set those up too. I think to avoid all this one day I will just use an IDE or a virtual environment.
Anyway, here are the steps.
Install Anaconda (and Jupyter Notebooks)
- Go to the Anaconda website and download the latest distribution for Mac.
- Follow all the installation steps. It should install to the
/Users/<user>/anaconda3/bin/anaconda
path. If you gowhich anaconda
in Terminal it will show this path. - Jupyter Notebooks will be installed with Anaconda in the
/Users/<user>/anaconda3/bin/jupyter-notebook
folder.
Create commands and aliases for bash/zsh to make Anaconda and Jupyter Notebooks run
- Go to your ~/.bashrc file (or ~/.zshrc file in my case since I use zsh)
- To make Anaconda executable, add
export PATH=$PATH:$HOME/anaconda3/bin
to the file. This will allow you to use theconda
shortcut in Terminal. - To run Jupyter Notebooks with a simple
jupyter-notebook
command, addalias jupyter-notebook="/Users/<user>/anaconda3/bin/jupyter-notebook"
to the file.
Deal with this ridiculous matplotlib font cache issue
Do what this StackOverflow post says to do.