Fixing error – Zsh: Conda/Pip installs command not found ( zsh: command not found: conda )

error – Zsh: Conda/Pip installs command not found ( zsh: command not found: conda ) is an error which might occur because of faulty anaconda and zsh installations.

This post is my attempt to explain to you why this error occurs and how you can solve it, I will also include multiple solutions that could be considered as alternative fixes to the error.

Exploring the error – Zsh: Conda/Pip installs command not found ( zsh: command not found: conda )

This is a very popular error which might occur because of faulty anaconda and zsh installations.

The error you should have should be similar to the error bellow. Please make sure you do not confuse between errors.

                                                                       #
zsh: command not found: conda
                                                                       #

Bellow I make my best attempt at solving the error and present the best possible solution.

Solution 1 : for Anaconda and MacOS users

The first solution is only for Anaconda and MacOS users.

The first step is to find your username using the command bellow.

                                                                       #
echo $USER # find your username then please copy it
                                                                       #

Followed by the command bellow, please paste the username you copied before and paste it to replace username in the command bellow.

                                                                       #
source /Users/username/opt/anaconda3/bin/activate
                                                                       #

Us the command bellow to initialize zsh

                                                                       #
conda init zsh # use 'conda init' if you are using a bash shell
                                                                       #

The error should be gone after executing these commands, you can use conda list to check if the solution has been successful. Try the solution bellow if this did not work.

Solution 2 : use the source ~/.zshrc command

The second solution is a very effective command that should be accompanied with other commands.

Before using the source ~/.zshrc command. Start by using the command bellow

                                                                       #
vim ~/.zshrc
                                                                       #

Now, add this line: source ~/.bash_profile to the .zshrc file we have just opened with the command above.

Finally you can run the last command bellow and the error should be gone.

                                                                       #
source ~/.zshrc
                                                                       #

Summing-up

This is one of those errors that are hard to explain, I hope my article helped you solve this common issue, keep coding and learning, cheers.

If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/