Install anaconda on macOS using Homebrew

Ayuth Mangmesap
Ayuth’s Story
2 min readMar 21, 2019

--

https://brew.sh/assets/img/homebrew-social-card.png

Instead of spend time for hours to setup an environment and install hundred of dependencies for Data Science work, we must spend time on the work instead of setup right?

That’s why we need anaconda. In this blog, I’ll demonstrate how easy to install anaconda with brew step by step.

Anaconda Distribution

The World’s Most Popular Python/R Data Science Platform

The open-source Anaconda Distribution is the easiest way to perform Python/R data science and machine learning on Linux, Windows, and Mac OS X. With over 11 million users worldwide, it is the industry standard for developing, testing, and training on a single machine, enabling individual data scientists to:

Contents

  1. Download homebrew.
  2. Install the package via homebrew.
  3. Set up the environment path.

Download homebrew and zsh

I recommended you download homebrew and zsh, if you’re not familiar with this go to read this blog before continuing reading this blog.

Install anaconda via homebrew

  1. Install anaconda via brew cask by executing

Let’s run Jupyter notebook

Try to executing jupyter notebook in your terminal.

It’s not working… why? Because our shell doesn’t know where the anaconda folder is, let’s add that folder to our shell path.

Set up the environment path.

Insert a line below on top of your ~/.zshrc file because when you try to execute python on the terminal, it’ll search for the folder /usr/local/anaconda3/bin first, before searching on the default operating system path which means you can execute jupyter notebook and python .


$ echo 'export PATH="/opt/homebrew/anaconda3/bin:$PATH"' >> ~/.zshrc
$ source ~/.zshrc

Restart the terminal or use source ~/.zshrc to reload your shell environment and execute jupyter notebook an output will be like this

$ jupyter notebook

--

--