While interacting with python, we often use virtual environments to maintain our project or application. However, many times we ran into some errors because of this. Either we got the error for module installation, import, or due to missing files. Today in this article, we will discuss one such problem, i.e., zsh: command not found conda.
What is zsh: command not found conda?
The zsh command not found error is raised by the shell when our system cannot find the desired file. In the case of the conda environment, the system raises the zsh command not found conda, which means that the system is unable to fetch the conda file, and hence the error is raised.
Why do I get zsh: command not found conda Error?
There may be two reasons to get the error. The first one is that conda is not installed in your system, so the system cannot locate it. The second reason might be that the conda is installed in the system but fails to locate the conda because of the incorrect path specified.
Two Solution For zsh command not found conda Error
Now, once you understood the error. It’s time to solve it. To solve the problem, you need to follow the solution as per your requirement.
Solution 1: If conda is not installed in the system
The solution is that you need to install Anaconda in your system for the given reason. You can follow this link to download it.
Anaconda: https://www.anaconda.com/download/
Solution 2: If path to conda in not specified
However, it may also happen that even if Anaconda is installed in your system and you can get the error then, you should specify the path in .zshrc
the file. To add the path in that file, you should first open the .zshrc file and then write the following code there.
export PATH="$PATH:/Users/Dz/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/Dz/.rvm/bin"
Then, you can run the following command to check it.
source ~/.zshrc
echo $HOME
echo $PATH
Your problem is solved.
zsh command not found in brew
However, the error is not limited to conda only. You may also get the error while using Homebrew. So, the reason for the error is similar here, as discussed above. It may be the reason that Homebrew is not installed in the system. In that case, one needs to install it. On the contrary, there could be one more reason that the path to Homebrew is not mentioned in the path variable, so one needs to specify that. To do that, you need to find .zshrc
file and add the following line of code in that.
export PATH="$PATH:/Users/Dz/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/Dz/.rvm/bin"
Zsh vs Bash
Zsh or Z-shell is the extension of the bash shell, which provides more features and functionality than the Bash shell.
- Z-shell is comparatively faster than bash shell.
- Z-shell is more configurable with respect to the Bash shell.
- Zsh has more plugins and themes in comparison to the Bash shell.
- Changing directories can be easily done in zsh
- Auto completion is supported by Zsh but not by Bash shell.
- Zsh also correct spelling mistakes while the option is not available in bash shell.
- Zsh has more themes and plugins than bash shell.
- Count of users of zsh is comparatively lower than bash shell.
Installing Zsh in Linux or MacOS
In Linux
You can use the following series of commands to install Zsh on Linux.
sudo apt update
sudo apt upgrade
sudo apt install zsh
On MacOs
For mac os, use the following series of commands.
usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
Install zsh
brew install zsh
Set Zsh to Default
sudo sh -c "echo $(which zsh) >> /etc/shells" && chsh -s $(which zsh)
FAQs on Zsh Command not found Conda
Yes, it is better than bash as it has more features than bash.
Yes, it is comparatively faster than bash.
Conclusion
So, today in this article, we have seen what is zsh command is not found conda Error? Then, we have seen different reasons for the error. At the end of the article, we have seen how we can solve our error depending on the reason for the error.
I hope this article has helped you. Thank You.