Fixing zsh anaconda error – Conda command not found

zsh anaconda error – Conda command not found is an error which occurs when zsh has not been set up to read the .bashrc file.

In this article I am going to show you why this error is happening and how you can solve this error. I am also going to share with you other possible solutions which have worked for many developers who suffered from this error.

Exploring the Error : zsh anaconda error – Conda command not found

This is an error which occurs when zsh has not been set up properly to read the .bashrc file.

The error usually looks like the error bellow. Make sure yours is similar.

                                                                       #
conda: command not found
                                                                       #

In the sections bellow we will explain the root of the error more and propose some possible fixes.

Solution : execute ‘source ~/.bashrc’ or edit the .zshrc file

The root of the issue here is that zsh does not read the .bashrc file. This solution is going to be a step by step solution where I will tell you things to try Step by Step until you get rid of the issue.

First thing we will try is to do is Type bash in your terminal. This is because in many cases the terminal is not looking for the .bashrc file.

Try this command now and if you still get the error lets skip to the second option.

                                                                       #
conda --version
                                                                       #

If the bash is not being read we can force execute it using the command bellow.

                                                                       #
source ~/.bashrc
                                                                       #

If that does not solve the problem, then maybe we have a problem related to the shell PATH environment variable.

The last option is to open the .zshrc file and add this line to it in order to add the Miniconda directory to the zsh shell PATH. Please replace /home/…./miniconda/ with the one on your machine.

Close and restart the terminal and the error should be gone.

                                                                       #
export PATH="/home/..../miniconda/bin:$PATH"
                                                                       #

The solution above should be enough to cover the error in most environments, I wish you good luck with your projects.

Summing-up

If the solutions above helped you, consider supporting us on Kofi, any help is appreciated.

I hope my article was helpful in solving this error, errors are part of our journey of coding with Python, keep learning, keep coding and cheers. If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/