Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 657
Nathan Furnal Avatar asked Dec 05 '18 15:12

Nathan Furnal


1 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:\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"

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:\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.

like image 193
user2361174 Avatar answered Sep 22 '22 05:09

user2361174