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.
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.
Without more information, I would suggest checking that it’s one of the last versions.
When I enter the command
~ brew cask install anaconda
I get this:
Error: Unknown command: cask
Did you put the whole command entirely in one line?
The command is `brew install –cask anaconda’
Oh, I see now. cask has to hyphens. Try:
brew install –cask anaconda