Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
649 views
in Technique[技术] by (71.8m points)

anaconda - 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:homeminiconda

  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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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]Anaconda3Scripts 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...