Conda command not found

Posted on

Question :

Conda command not found

I’ve installed Miniconda and have added the environment variable export PATH="/home/username/miniconda3/bin:$PATH" to my .bachrc and .bash_profile but still can’t run any conda commands in my terminal.

Am I missing another setup? I’m using zsh by the way.

Asked By: olivrg

||

Answer #1:

If you’re using zsh and it has not been set up to read .bashrc, you need to add the Miniconda directory to the zsh shell PATH environment variable. Add this to your .zshrc:

export PATH="/home/username/miniconda/bin:$PATH"

Make sure to replace /home/username/miniconda with your actual path.

Save, exit the terminal and then reopen the terminal. conda command should work.

Answered By: olivrg

Answer #2:

If you have the PATH in your .bashrc file and are still getting

conda: command not found

Your terminal might not be looking for the bash file.
Type
bash in the terminal to insure you are in bash and then try:
conda --version

Answered By: Kenan

Answer #3:

For those experiencing issues after upgrading to MacOS Catalina.

Short version:

# 1a) Use tool: conda-prefix-replacement - 
# Restores: Desktop -> Relocated Items -> Security -> anaconda3
curl -L https://repo.anaconda.com/pkgs/misc/cpr-exec/cpr-0.1.1-osx-64.exe -o cpr && chmod +x cpr
./cpr rehome ~/anaconda3
# or if fails
#./cpr rehome ~/anaconda3 --old-prefix /Anaconda3
source ~/anaconda3/bin/activate

# 1b) Alternatively - reintall anaconda - 
# brew cask install anaconda

# 2) conda init
conda init zsh
# or
# conda init    

Further reading – Anaconda blog post and Github discussion.

Answered By: xgMz

Answer #4:

Maybe you need to execute “source ~/.bashrc”

Answered By: dew

Answer #5:

Sometimes, if you don’t restart your terminal after you have installed anaconda also, it gives this error.

Close your terminal window and restart it.

It worked for me now!

Answered By: Sanreet

Answer #6:

Maybe you should type add this to your .bashrc or .zshrc

export PATH="/anaconda3/bin":$PATH

It worked for me.

Answered By: Seth

Answer #7:

Execute the following command after installing and adding to the path

source ~/.bashrc

where source is a bash shell built-in command that executes the content of the file passed as argument, in the current shell.

It runs during boot up automatically.

Answered By: Gursewak Singh

Answer #8:

I had the same issue. I just closed and reopened the terminal, and it worked. That was because I installed anaconda with the terminal open.

Answered By: Golddy

Leave a Reply

Your email address will not be published. Required fields are marked *