EASY install anaconda on macOS using homebrew

Installing anaconda on a macOS is not a simple task. Sometimes it requires a lot of troubleshooting, like setting the right shell initialization. To solve this I propose to install anaconda through homebrew. All of these commands are performed through the terminal unless otherwise specified in step 3.

1. Install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Install anaconda

brew install --cask anaconda

3. Set the right anaconda path

Edit the ~/.zshrc file. You can do it using vim:

vim ~/.zshrc

And add the following line at the bottom:

export PATH="/usr/local/anaconda3/bin:$PATH"

This sets the anaconda directory on the global path variable from the macOS operating system.

4. Restart the terminal

You can either close the terminal or load the path configuration running:

source ~/.zshrc

5. Initialize conda’s shell

You have several options bash, fish, tcsh, xonsh, zsh, and powershell. But I recommend the following

conda init zsh

That’s it! Otherwise, shoot me a comment and we’ll figure out.

Join the Conversation

8 Comments

  1. I like your idea about installing Anaconda via Homebrew.
    I have a MacBook Air/M1.
    I can get Python 3.9 working, IDLE3.9 working, JupyterLab via Anaconda working, but I can’t get Pandas working. I am inexperienced re switching between native and emulating the Intel. I have read the StackExchange comments, but still unsuccessful. Would appreciate your guidance.

    1. If conda is already installed make sure you add its path to the environment variable:

      export PATH =”/Users/c2c/anaconda/bin:$PATH”

Leave a comment

Your email address will not be published. Required fields are marked *