Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install anaconda through home-brew m1 mac m2 m3 m4

I just got an m1 Mac and installed anaconda using home-brew:

brew install anaconda

It looked like it worked great, except that when I actually go to use anaconda and type "conda" I get the dreaded "conda command not found" error. How do I fix this?

Based on the answer given by @Peter here as well as the anaconda documentation, adding to path is no longer recommended. The answers here also did not solve the problem.

like image 422
BLimitless Avatar asked Dec 10 '25 18:12

BLimitless


2 Answers

Figured it out! Challenge lay in the home-brew path. To run the conda init zsh command, detailed by @Sebastian in the answer here, I had to specify home-brew, as well as back up a couple directories. The command that actually got it done in terminal was:

/opt/homebrew/anaconda3/bin/conda init zsh

Happy home-brew anaconda-ing on your new m1s everyone.

like image 166
BLimitless Avatar answered Dec 13 '25 07:12

BLimitless


I ran into this same issue when installing condo on my Mac M2 with brew e.g. homebrew.

Complete list of steps I ran, to resolve that:

$ brew install anaconda
...
PREFIX=/opt/homebrew/anaconda3
...
$ /opt/homebrew/anaconda3/bin/conda init $(basename $SHELL)
modified      /Users/ritvik/.zshrc

==> For changes to take effect, close and re-open your current shell. <==

N.B. when running brew install anaconda, brew itself prints the folder path to anaconda installation in the terminal. You can see it in above:

PREFIX=/opt/homebrew/anaconda3

Just tack on a /bin/conda to that directory, and one will locate the condo executable path.

like image 29
rv.kvetch Avatar answered Dec 13 '25 08:12

rv.kvetch