zsh

How to Fix – zsh: command not found: conda Error on Mac

The “zsh: command not found: conda” error is a common issue when you try to use the “conda” command in Zsh, but the shell cannot find it in its list of recognized commands. This error prevents you from running conda-related commands and performing tasks associated with conda.

In this article, we will guide you through simple steps to fix the “zsh: command not found: conda” error, enabling you to use conda within the Zsh shell without any issue.

How to Fix-zsh: command not found: conda on Mac

To fix the “zsh: command not found: conda” error on macOS, follow the steps below:

Step 1: Check Conda Installation

Start by verifying if conda is installed on your system and for that open the terminal and run the command:

conda --version

Step 2: Download Conda

To start the conda installation, you must need to download the conda installation script using the following command:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh

Step 3: Give Execute Permission to the File

You must provide execute permission to the conda script file from the following command so that you can run it on Zsh.

chmod +x ./miniconda.sh

Step 4: Execute the Conda Script File

Once the execute permission is granted, you can run the conda script file from the following command:

./miniconda.sh

Accept the License terms, and select the directory location to perform the conda installation on Zsh.

Select “yes” on the final option to initialize the conda init.

Step 5: Reload the Changes

To use conda and its environments, you need to activate the conda environment; in Zsh, use the following command to activate the base environment:

source /Users/awaiskhan/miniconda3/bin/activate

Note: Make sure to replace the username in the above command, the rest path will remain the same.

Step 6: Test the Conda Installation

After completing the above steps, close and reopen the Zsh terminal to ensure that the changes take effect; then, run the following command to verify if conda is successfully installed on your Mac:

conda --version

If the command runs without any errors and displays the conda version information, you have fixed the zsh: command not found: conda error and successfully installed conda on your Zsh shell.

Conclusion

You can fix the zsh: command not found: conda on macOS by verifying the conda installation, downloading the script, granting execute permission, executing the script, reloading changes, and testing the installation. Carefully performing these steps will allow you to fix the errors and harness the power of conda within your Zsh environment.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.