mdivk
mdivk

Reputation: 3727

Anaconda: ModuleNotFoundError: No module named 'conda'

Please note this error is different than what shows up (and has answer) in stackoverflow. It is definitely not duplicated.

I have seen this error before and has been able to fix it by modifying the PATH to include conda's path like below:

export PATH=/opt/cloudera/parcels/Anaconda/bin:$PATH
echo $PATH
/opt/cloudera/parcels/Anaconda/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/git/bin:/home/rxie/bin

For unknown reason, the error pops up again here, and doesn't go away even after I started a new session.

The last command I executed was:

conda upgrade -c conda-forge imbalanced-learn

and the command completed successfully.

What's wrong with conda?

Here is the directory of Anaconda:

#ls -la /opt/cloudera/parcels/Anaconda/bin/conda
-rwxrwxr-x 1 root root 531 Feb 18 16:29 /opt/cloudera/parcels/Anaconda/bin/conda

Note I have been using root to install packages.

Any clue is appreciated.

Thank you very much.

UPDATE: Thank you @merv, I read your answer to the other thread. Not exactly same symptom though, I indeed tried out the first step which is to sudo pip install conda, after that, expectedly conda still throw same error so there is no way to continue with step 2 in your answer of conda install --revision <n-1>

Upvotes: 7

Views: 21111

Answers (2)

stuti tiwari
stuti tiwari

Reputation: 1

I encountered similar problem when I was trying to install opencv, I execute following command on windows powershell:

conda install -c conda-forge opencv

The powershell gave the following error

conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • conda install -c conda-forge opencv
  • CategoryInfo : ObjectNotFound: (conda:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

So I entered the condabin directory using cd command:

cd C:\Users\username\anaconda3\condabin

and executed following command

.\conda install -c conda-forge opencv

opencv got installed

So U too can navigate to condabin directory and then use .\conda instead of conda

It worked for me I hope it helps you too

Upvotes: 0

Aurelio Vivas
Aurelio Vivas

Reputation: 86

I solve this problem installing the version 4.6.14 of conda as suggested on this issue 9004 before perform further installs.

conda install conda=4.6.14

It looks like further versions of conda are introducing this error.

Upvotes: 2

Related Questions