Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After updating conda I get a CommandNotFoundError for conda

After updating conda I can no longer run commands such as conda list, I now see the following error when I try a conda command:

CommandNotFoundError: No command 'conda conda'

The conda update was performed like so:

$ conda update -n base -c defaults conda
Collecting package metadata: ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: C:\home\miniconda

  added / updated specs:
    - conda


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-4.6.9                |           py37_0         1.7 MB
    ------------------------------------------------------------
                                           Total:         1.7 MB

The following NEW packages will be INSTALLED:

  pip                pkgs/main/win-64::pip-19.0.3-py37_0

The following packages will be UPDATED:

  conda                                        4.6.8-py37_0 --> 4.6.9-py37_0


Proceed ([y]/n)?


Downloading and Extracting Packages
conda-4.6.9          | 1.7 MB    | ########## | 100%
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done

My .bashrc file has the following line in it, and it also results in the above error upon creation of a new git/bash console on Windows 10:

eval "$('/c/home/miniconda/Scripts/conda.exe' 'shell.bash' 'hook')"

Is the above part of the problem?

My PATH environment variable contains conda-related paths at the front:

$ echo $PATH
/c/home/miniconda/condabin:/c/home/miniconda/Scripts:...

$ which conda
/c/home/miniconda/Scripts/conda

$ ll /c/home/miniconda/condabin
total 16
-rw-r--r-- 2 James Adams 197121 1995 Mar 29 21:46 _conda_activate.bat
-rw-r--r-- 2 James Adams 197121  147 Mar 29 21:46 activate.bat
-rw-r--r-- 2 James Adams 197121 1063 Mar 29 21:46 conda.bat
-rw-r--r-- 2 James Adams 197121  530 Mar 29 21:46 conda_auto_activate.bat
-rw-r--r-- 2 James Adams 197121  649 Mar 29 21:46 conda_hook.bat
-rw-r--r-- 2 James Adams 197121  192 Mar 29 21:46 deactivate.bat
-rw-r--r-- 2 James Adams 197121   65 Mar 29 21:46 rename_tmp.bat

Can anyone suggest how to fix this issue?

like image 882
James Adams Avatar asked Apr 02 '19 14:04

James Adams


People also ask

How do I update Conda to the latest version?

Access your start menu in the bottom-left corner and search for “anaconda“. Then, click on Anaconda Prompt. Use the start menu to open Anaconda Prompt. Inside the Anaconda Prompt program, run the following commands and press Enter after each one to update Conda to the latest version: conda update conda install.

How to fix Conda command not working in Windows 10?

Here’s a quick guide on how you can rectify this: Access your start menu in the bottom-left corner and search for “ anaconda “. Then, click on Anaconda Prompt. Wait until the process is complete, then close the Anaconda Prompt and open a CMD window. See if you’re now able to run Conda commands.

How do I run Conda commands in Anaconda?

Access your start menu in the bottom-left corner and search for “ anaconda “. Then, click on Anaconda Prompt. Wait until the process is complete, then close the Anaconda Prompt and open a CMD window. See if you’re now able to run Conda commands.

How do I fix Anaconda is not recognized as an external command?

Configuring Anaconda’s installation to add the PATH environment variable automatically. Once the installation is complete, type “conda” inside a Command Prompt. You should no longer see the “conda is not recognized as an internal or external command, operable program or batch file” error.


1 Answers

This cropped up for me today too. It appears to be a bug in conda 4.6.9.
I deleted everything conda-related but C:\Users\[username]\Anaconda3 and C:\Users\[username]\Anaconda3\Scripts from my PATH and conda commands started working. I still couldn't run source activate [environment] in bash without getting:

CommandNotFoundError: No command 'conda conda'

So I downgraded to 4.6.8 with:

conda install conda=4.6.8

And it solved my problem.

like image 84
Greg Allan Avatar answered Sep 28 '22 03:09

Greg Allan