更新conda后,我得到一个conda的CommandNotFoundError

时间:2019-04-02 14:56:59

标签: anaconda conda git-bash

更新conda后,我将无法再运行诸如conda list之类的命令,现在我在尝试conda命令时看到以下错误:

CommandNotFoundError: No command 'conda conda'

conda更新是这样执行的:

$ 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

我的.bashrc文件中包含以下行,并且在Windows 10上创建新的git / bash控制台时,也会导致上述错误:

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

问题是否出在上面?

我的PATH环境变量在前面包含与conda相关的路径:

$ 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

有人可以建议如何解决此问题吗?

2 个答案:

答案 0 :(得分:7)

今天对我来说也是这样。它似乎是conda 4.6.9中的错误。
我从PATH中删除了与conda相关的所有内容,但C:\Users\[username]\Anaconda3C:\Users\[username]\Anaconda3\Scriptsconda命令开始起作用。我仍然无法在bash中运行source activate [environment],而不会得到:

CommandNotFoundError: No command 'conda conda'

所以我用以下命令降级到4.6.8:

conda install conda=4.6.8

它解决了我的问题。

答案 1 :(得分:0)

我也一直收到此错误。就像格雷戈里·艾伦(Gregory Allan)所说的那样,将conda降级为4.6.8已为我修复,一切都会按预期进行。

无需在终端中运行命令即可降级的另一种方法是使用Anaconda Navigator,然后可以选择要更新或降级的软件包。