Command Not Found for Conda and Pip in Zsh

Zsh: Command Not Found for Conda/Pip After Switching to oh-my-zsh I recently installed Anaconda, and everything was working fine initially. However, after switching to oh-my-zsh, I encountered an issue. Whenever I try to use pip or conda installs, I get the following error:

zsh: command not found: conda

I checked my Zsh version: echo $ZSH_VERSION 5.0.5

To resolve the “zsh command not found Python” issue, I added the following line to my zshenv.sh file:

export PATH=“/Users/Dz/anaconda/bin:$PATH”

Despite this, the error persists. What am I missing or doing wrong? How can I fix this so I can use pip and conda commands properly in Zsh?

Hey, I’ve been there! Zsh can be tricky when dealing with PATH issues. Here’s how I resolved a similar problem…”

Start by double-checking your PATH variable. Open your .zshrc file and ensure it contains:

export PATH="/Users/Dz/anaconda/bin:$PATH"  

After adding it, don’t forget to reload Zsh by running:

source ~/.zshrc  

This should fix the zsh command not found python issue by ensuring Anaconda’s binaries are available globally. Give it a shot and let me know if it works!

That’s a solid start, Ambika! If tweaking the PATH didn’t resolve it, here’s something that often does the trick…

You need to initialize Conda specifically for Zsh. Run:

conda init zsh  

Once that’s done, restart your terminal to apply the changes. This step ensures Zsh knows how to handle Conda commands. I’ve seen this resolve many zsh command not found python errors caused by incomplete configurations.

Let us know if this clears things up or if you need a bit more help!

Great points so far! If neither of those options worked, this next step has been a game-changer in my experience…

Consider reinstalling Anaconda. Sometimes, installing Anaconda after switching to Oh-My-Zsh aligns everything properly. After reinstalling:

  1. Verify your .zshrc updates the PATH correctly.
  2. Test Conda with:
conda --version  

Reinstalling ensures Zsh and Anaconda integrate seamlessly, preventing future zsh command not found python issues.

Let us know how it goes sometimes it’s a combination of all these steps that resolves the issue!