Anaconda提示立​​即关闭-系统无法找到指定的注册表项或值 [英] Anaconda prompt closes immediately - the system was unable to find the specified registry key or value

查看:216
本文介绍了Anaconda提示立​​即关闭-系统无法找到指定的注册表项或值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Anaconda提示出现问题.

I'm having an issue with the Anaconda prompt.

一切都找到了,直到我创建了一个新环境,其中包含 PyMC3 .

Everything was find until I created a new environment with PyMC3 in it.

通常的方式:conda create -n myenv

,然后,在我将其激活后:conda install -c conda-forge pymc3

and then, after I activated it : conda install -c conda-forge pymc3

由于某些原因未安装软件包,因此我删除了环境.

For some reason the packages weren't installed so I deleted the environment.

现在,我遇到此错误,请点击此处查看图片:

Now, I'm getting this error, see picture here :

最后的错误:错误";消息翻译为:系统无法找到指定的注册表项或值".

The last "error : error" message translates to : "the system was unable to find the specified registry key or value".

现在奇怪的是,当我从导航器而不是提示符启动应用程序时,我可以访问环境并从那里启动笔记本或可视代码工作室,但是对于无法使用的基本环境.

Now what's weird is that when I start the application from the navigator instead of the prompt, I can access my envs and launch my notebook or visual code studio from there but for the base environment which doesn't work.

但是,尝试打开该提示会立即将其关闭,我相信它正在访问默认环境"base".而且,从导航器中,我无法从基本"菜单启动笔记本.

But trying to open the prompt closes it immediately, I believe it is accessing "base", the default env. Also, from the navigator I'm unable to launch a notebook from the "base" env.

这里的图片:

尽管我说过,其他环境也很好.

Though as I said, other environments are fine.

有人知道如何解决此问题吗?因此,我无法访问提示,我很幸运地抓住了它并拍摄了屏幕截图,否则立即关闭.

Does anyone know how to solve this issue ? I can't access the prompt because of it, I was just lucky enough to grab it and take a screenshot, it closes immediatlely otherwise.

P.S:我在联想笔记本电脑上使用Windows 10(Python 3.7),但在今天之前从未遇到过此问题.

P.S : I use Windows 10 on a Lenovo laptop, Python 3.7 and never had the issue before today.

谢谢

推荐答案

在更新我所有的软件包之后,这同样发生在我身上.我做了一些挖掘,错误来自C:\Users\username\AppData\Local\Continuum\miniconda3\etc\conda\activate.d\vs2015_compiler_vars.bat

This just happened to me as well after updating all of my packages. I did some digging and the error is coming from C:\Users\username\AppData\Local\Continuum\miniconda3\etc\conda\activate.d\vs2015_compiler_vars.bat

此文件的最后一行出现在错误之前:

This file has your last line before your error:

for /f "skip=2 tokens=2,*" %%A in ('reg query "%VSREGKEY%" /v InstallDir') do SET "VSINSTALLDIR=%%B"

如果在Windows命令提示符下运行reg query "%VSREGKEY%" /v InstallDir,则会收到与在Anaconda提示符下看到的相同错误.

And if you run reg query "%VSREGKEY%" /v InstallDiron your Windows command prompt, you'll get the same error you see on your Anaconda prompt.

我尝试进行一些更改以处理此错误,但是即使您成功通过了该操作,您也可能最终会收到此错误:Did not find VS in registry or in VS140COMNTOOLS env var - exiting之所以发生这种情况,是因为VSINSTALLDIR bash变量用于查找脚本后面的文件,但现在该目录显示为空.

I tried making some changes to handle this error but even if you manage to get past that you will likely end up getting this error : Did not find VS in registry or in VS140COMNTOOLS env var - exiting This is happening because the VSINSTALLDIR bash variable is meant for finding the vcvarsall.bat file later in the script but now that directory shows up as empty.

我无法在系统中找到任何vcvarsall.bat文件,可能是因为我尚未安装该文件用于的Visual Studio.一种解决方案是安装Visual Studio(2015版),并确保您具有InstallDir注册表项.但是我没有这样做,因为VS是一个非常大的程序(我认为是7 GB),目前我对此没有用.

I wasn't able to find any vcvarsall.bat file in my system, likely because I haven't installed Visual Studio which this file is meant for. One solution is to install Visual Studio (2015 version) and make sure you have the InstallDir registry key for it. But I didn't do this since VS is a pretty big program (7 GB I think) that I have no use for that at the moment.

我采取的解决方案是简单删除 C:\Users\username\AppData\Local\Continuum\miniconda3\etc\conda.我创建了一个新的miniconda安装(在不同的路径中),并发现该目录由于某种原因不存在,因此我想重新安装会执行相同的操作.我删除了第二个安装,而第一个仍在工作,因此我怀疑是否涉及任何依赖关系问题.就是说,我不知道该脚本的意图,也不知道没有该脚本会带来什么后果..

The solution I took is to simply delete C:\Users\username\AppData\Local\Continuum\miniconda3\etc\conda. I created a new miniconda installation (in a different path) and saw that this directory did not exist in it for whatever reason so I imagine that reinstalling would do the same thing. I deleted the second installation and the first one is still working so I doubt there's any dependencies issues involved. That said, I have no idea what that script was meant for and do not know what consequences may come without it. Full disclosure.

这篇关于Anaconda提示立​​即关闭-系统无法找到指定的注册表项或值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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