[英]Conda not recognized as internal or external after creating new environment
conda command was working fine from Anaconda prompt. conda命令在Anaconda提示符下工作正常。 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.
我为tensorflow
创建了一个新环境,然后它说 - '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 .我已经检查了我所有的PATH变量,并将 root、脚本和 lib 文件夹路径添加到PATH 中。
It just does not recognize any commands - conda, activate, deactivate, any of these.它只是不识别任何命令 - conda、激活、停用,任何这些。
It happened to me as well.它也发生在我身上。 I created a new env and was able to switch to the new env using command conda activate .我创建了一个新的 env,并且能够使用命令 conda activate 切换到新的 env。 But once I was in the new env I was not able to use conda command at all, even to deactivate the env.但是一旦我进入新的环境,我就根本无法使用 conda 命令,甚至无法停用环境。
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.我刚刚打开了一个新的 WIN 的命令提示符,然后切换到新的 env,然后就可以毫无问题地使用 conda 命令了。
I also faced the same issue.我也面临同样的问题。 PATH s were also fine but I was unable to execute the conda command. PATH也很好,但我无法执行conda命令。
While installing Anaconda , I had checked ADD TO PATH option, I think that created problem.在安装Anaconda 时,我检查了ADD TO PATH选项,我认为这造成了问题。
Anaconda does not recommend to do this. Anaconda不建议这样做。 You can see RED colored warning if you check the ADD TO PATH check box.如果您选中添加到路径复选框,您可以看到红色警告。
See the below 2 images.请参阅以下 2 张图片。
Before checking the box在检查框之前
After checking the box勾选框后
Finally I reinstalled the Anaconda without checking the check box ADD TO PATH then manually set the PATH .最后,我重新安装了Anaconda而不选中ADD TO PATH复选框,然后手动设置PATH 。
Better is to use your own custom location for Anaconda installation as I did.更好的是像我一样使用您自己的自定义位置进行Anaconda安装。
I do not know, in which system you are working.我不知道,你在哪个系统中工作。 I am windows user and solved the issue as follows.我是 Windows 用户,并按如下方式解决了该问题。
Uninstalled the currently installed Anaconda .卸载当前安装的Anaconda 。
Created folder named C:\\AnacondaPython
for reinstallation of Anaconda .创建名为C:\\AnacondaPython
文件夹,用于重新安装Anaconda 。
Manually added the following 5 PATHS to PATH environment variable.手动将以下 5 个PATHS添加到PATH环境变量中。
C:\\AnacondaPython C:\\蟒蛇蟒
C:\\AnacondaPython\\Scripts C:\\AnacondaPython\\Scripts
C:\\AnacondaPython\\Library C:\\AnacondaPython\\库
C:\\AnacondaPython\\Library\\mingw-w64\\bin C:\\AnacondaPython\\Library\\mingw-w64\\bin
C:\\AnacondaPython\\Library\\usr\\bin C:\\AnacondaPython\\Library\\usr\\bin
Or you can just append the below PATH series.或者您可以仅附加以下PATH系列。
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.所以最后,我打开了新的终端,并尝试创建、激活和停用tensorflow
环境。
Please check my Terminal
s history that is given below.请检查下面给出的我的Terminal
的历史记录。
(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.我建议您重新安装Anaconda以解决此问题。
Thanks.谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.