Getting Anaconda to work with Oh My ZSH on Mac OS X

Sumit Menon
Oct 13, 2018 · 1 min read

I recently installed Anaconda3 on my Macbook Air, with the intention of working with Jupyter Notebook.

Everything seemed to work fine with bash on Terminal, but ZSH on iTerm2 could not find the jupyter notebook command.

It looks like there is some additional configuration that you need to do to get it to work. Here it is…

Open the .bash_profile file using:

open ~/.bash_profile

There’s a block of code the anaconda installer added to the end of the file. Copy that.

Mine looks something like this:

# added by Anaconda3 5.3.0 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<

Now open your .zshrc file:

open ~/.zshrc

Paste the copied code to the end of the file and save it.

Now do a iTerm restart or:

source ~/.zshrc

It should work now. :)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade