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

Question:

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

Asked By: Nathan Furnal

||

Answers:

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.

Answered By: user2361174

After installing keras I got the same problem.

I checked Anaconda Navigator > Environments for a related package. I found vs2015_win-64 package that said

Activation and version verification of MSVC 14 (VS 2015) compiler

I was not able to remove the package using the Anaconda Navigator.

Anaconda prompt closes immediately after the error message but there is enough time to stop the command execution with Ctrl + C + Enter. Now I was able to use the Anaconda prompt to remove the package.

Anaconda prompt:

conda uninstall vs2015_win-64
Answered By: Lasileuka

I got ran out of this by uninstalling the theano package. I confronted this log right after installing the theano package, So I assumed that the root of the problem was related to this package. After uninstalling it using conda uninstall theano, everything got Ok, and I don’t see this log anymore!

Answered By: Shayan
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.