Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

python - Anaconda prompt closes immediately - the system was unable to find the specified registry key or value

I'm having an issue with the Anaconda prompt.

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

The usual way : conda create -n myenv

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 :

enter image description 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.

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.

Picture here :

enter image description here

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 : I use Windows 10 on a Lenovo laptop, Python 3.7 and never had the issue before today.

Thanks

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

This just happened to me as well after updating all of my packages. I did some digging and the error is coming from C:UsersusernameAppDataLocalContinuumminiconda3etccondaactivate.dvs2015_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"

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.

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.

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.

The solution I took is to simply delete C:UsersusernameAppDataLocalContinuumminiconda3etcconda. 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...