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:
Step 2: Download Conda
To start the conda installation, you must need to download the conda installation script using the following command:
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.
Step 4: Execute the Conda Script File
Once the execute permission is granted, you can run the conda script file from the following command:
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:
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:
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.