创建新环境后,Conda无法识别为内部或外部 [英] Conda not recognized as internal or external after creating new environment

查看:475
本文介绍了创建新环境后,Conda无法识别为内部或外部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

conda 命令在 Anaconda 提示符下工作正常.我为tensorflow创建了一个新环境,其后显示-'conda' is not recognized as an internal or external command,operable program or batch file.

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.

我已经检查了所有 PATH 变量,并且根目录,脚本和lib文件夹路径已添加到 PATH .

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

它只是无法识别任何命令-conda,激活,停用所有这些命令.

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

推荐答案

我也遇到了同样的问题. PATH 也很好,但是我无法执行 conda 命令.

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

在安装 Anaconda 时,我已经选中了 ADD TO PATH (添加到路径)选项,我认为这是一个问题.

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

Anaconda 不建议这样做.如果选中 ADD TO PATH (添加到路径)复选框,则会看到 RED 彩色警告.

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

请参见下面的2张图片.

See the below 2 images.

在选中该框之前

选中该框

最后,我重新安装了 Anaconda ,而没有选中复选框 ADD TO PATH ,然后手动设置了 PATH .

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

最好像我一样使用自己的自定义位置进行 Anaconda 安装.

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

我不知道您在哪个系统上工作.我是Windows用户,解决了以下问题.

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

  1. 卸载了当前安装的 Anaconda .

创建了名为C:\AnacondaPython的文件夹,用于重新安装 Anaconda .

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

手动将以下5个 PATHS 添加到 PATH 环境变量.

Manually added the following 5 PATHS to PATH environment variable.

C:\ AnacondaPython

C:\AnacondaPython

C:\ AnacondaPython \ Scripts

C:\AnacondaPython\Scripts

C:\ AnacondaPython \ Library

C:\AnacondaPython\Library

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

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

C:\ AnacondaPython \ Library \ usr \ bin

C:\AnacondaPython\Library\usr\bin

或者,您可以仅添加以下 PATH 系列.

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

因此,最后,我打开了新的 Terminal ,并尝试创建,激活&停用tensorflow环境.

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

请检查下面提供的我的Terminal历史记录.

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>

我建议您重新安装 Anaconda ,以解决此问题.

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

谢谢.

这篇关于创建新环境后,Conda无法识别为内部或外部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆