1

conda command was working fine from Anaconda prompt. I created a new environment for tensorflow after which it says - 'conda' is not recognized as an internal or external command,operable program or batch file.

I have checked all my PATH variables, and root, scripts and lib folder paths are added to the PATH.

It just does not recognize any commands - conda, activate, deactivate, any of these.

hygull
  • 8,464
  • 2
  • 43
  • 52
skoundin
  • 192
  • 1
  • 6
  • 19

2 Answers2

2

It happened to me as well. I created a new env and was able to switch to the new env using command conda activate . But once I was in the new env I was not able to use conda command at all, even to deactivate the env.

I just opened a new WIN's command prompt then switched to the new env and then was able to use conda command with no issues.

Arif Shaikh
  • 79
  • 3
  • 10
1

I also faced the same issue. PATHs were also fine but I was unable to execute the conda command.

While installing Anaconda, I had checked ADD TO PATH option, I think that created problem.

Anaconda does not recommend to do this. You can see RED colored warning if you check the ADD TO PATH check box.

See the below 2 images.

Before checking the box

enter image description here

After checking the box

enter image description here

Finally I reinstalled the Anaconda without checking the check box ADD TO PATH then manually set the PATH.

Better is to use your own custom location for Anaconda installation as I did.

I do not know, in which system you are working. I am windows user and solved the issue as follows.

  1. Uninstalled the currently installed Anaconda.

  2. Created folder named C:\AnacondaPython for reinstallation of Anaconda.

  3. Manually added the following 5 PATHS to PATH environment variable.

    C:\AnacondaPython

    C:\AnacondaPython\Scripts

    C:\AnacondaPython\Library

    C:\AnacondaPython\Library\mingw-w64\bin

    C:\AnacondaPython\Library\usr\bin

Or you can just append the below PATH series.

C:\AnacondaPython;C:\AnacondaPython\Scripts;C:\AnacondaPython\Library;C:\AnacondaPython\Library\mingw-w64\bin;C:\AnacondaPython\Library\usr\bin

So finally, I opened new Terminal, and tried to create, activate & deactivate tensorflow environment.

Please check my Terminals history that is given below.

(base) C:\Users\sunil kumar>conda create --name tensorflow
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.4.10
  latest version: 4.4.11

Please update conda by running

    $ conda update -n base conda


## Package Plan ##

  environment location: C:\AnacondaPython\envs\tensorflow


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate tensorflow
#
# To deactivate an active environment, use
#
#     $ conda deactivate


(base) C:\Users\Rishikesh>conda activate tensorflow

(tensorflow) C:\Users\Rishikesh>conda deactivate

(base) C:\Users\Rishikesh>

I will suggest you reinstall your Anaconda to get rid of this issue.

Thanks.

hygull
  • 8,464
  • 2
  • 43
  • 52
  • In my case (Windows) adding "C:\Users\\[Miniconda3 | Anaconda3]\Scripts" was enough to solve the problem without reinstallation (see https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/8KUBC81_t_k) – Mike Apr 13 '19 at 11:39
  • Yeah, actually that is sufficient to start. Actually, what I have mentioned in my answer is a result of a research work. Anaconda installer sets all the above entries if you check **Add to PATH** option but that causes problems later (so manual PATH setting is better). So once you will move any development where Anaconda/Miniconda really needs any of these, in that case you may face issues. But most of the suggestions will still suggest to set the path to **Scripts** and **Anaconda HOME**. – hygull Apr 14 '19 at 01:50