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:
And add the following line at the bottom:
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:
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.