zsh command not found: conda after upgrading to Catalina and even after reinstalling Anaconda
Asked Answered
R

3

6

I recently updated my MacOS to Catalina, and now I have the infamous "zsh command not found: conda" when I enter "conda" in my terminal. I've read a number of solutions, and the easiest for me to try was to reinstall Anaconda in my home directory (specifically, the 2019.10 version of the installer installs in Users/myname/opt/anaconda3), as suggested by the folks at Anaconda here.

Well, I did just that and it did not solve the problem. What am I missing?

Refugee answered 21/1, 2020 at 2:31 Comment(3)
Conda installs scripts for bash, but not zsh. The easiest way is to fire up bash, and run conda init zsh (from bash) this will put the appropriate code in you zsh profile (you'll need to start a new terminal session).Daggna
Thank you for your help. I switched my user account to bash and found that conda ran immediately without additional work. I guess that's because conda runs on bash. But I did the zsh switch as you suggested, and the conda command works now on zsh.Refugee
Glad it worked.Daggna
D
21

From the Anaconda install docs:

In order to initialize after the installation process is done, first run source <path to conda>/bin/activate and then run conda init.

However,

If you are on macOS Catalina, the new default shell is zsh. You will instead need to run source <path to conda>/bin/activate followed by conda init zsh.

Dominicdominica answered 21/1, 2020 at 3:45 Comment(4)
Thank you for your help. I did as suggested by the install docs and it works fine now.Refugee
Yup the activation is the problem after installation this step should be automaticLeslie
please feel free to mark the answer as accepted the clicking the tick.Dominicdominica
This worked for me too -- should be accepted, I spent some time on other answers which didn't help @AshtonT.SperryMorelos
S
0

I tried in Macbook M1 Air with the following command.

(your conda installation path)/bin/conda init zsh

Example:

/Users/<username>/opt/anaconda3//bin/conda init zsh

Then restarted the terminal and executed the command

conda activate base

It worked perfectly

Source command is taken is from here

Sansbury answered 24/3, 2022 at 14:3 Comment(0)
M
0

After installing miniconda on macos, we need to initialize the zsh. Different from the command ~/miniconda3/bin/conda init for the legacy bash, we need to add zsh in the end, i.e., ~/miniconda3/bin/conda init zsh. Then restart the terminal.

Marlomarlon answered 20/9, 2022 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.