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.

Newsletter subscription

10 Replies to “EASY install anaconda on macOS using homebrew”

  1. Rusty says:

    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.

  2. Gent says:

    When I enter the command
    ~ brew cask install anaconda
    I get this:
    Error: Unknown command: cask

  3. sean says:

    The command is `brew install –cask anaconda’

  4. Seif Eddine Shili says:

    Hello, i get zsh: command not found: conda
    everytime, please help thanks you.

    • Roc Reguant says:

      If conda is already installed make sure you add its path to the environment variable:
      export PATH =”/Users/c2c/anaconda/bin:$PATH”

  5. Shlomi Asaf says:

    On my mac, I had to configure the PATH this way: ‘export PATH=”/opt/homebrew/anaconda3/bin:$PATH”‘

Leave a Reply

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