Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keras installation get error that the system was unable to find the specified registry key or value #13209

Closed
idohi opened this issue Aug 11, 2019 · 28 comments

Comments

@idohi
Copy link

idohi commented Aug 11, 2019

OS: Windows10
python: 3.6.8
conda: 4.5.4

To reproduce:

  1. open anaconda prompt
  2. run: conda activate <my_environment>
  3. run : conda install -c conda-forge keras

Output:

conda install -c conda-forge keras
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.7.11

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: C:\Users\Ido\AppData\Local\conda\conda\envs\py36

  added / updated specs:
    - keras


The following NEW packages will be INSTALLED:

    keras:         2.2.4-py36_1            conda-forge
    libgpuarray:   0.7.6-hfa6e2cd_1003     conda-forge
    mako:          1.1.0-py_0              conda-forge
    pygpu:         0.7.6-py36h452e1ab_1000 conda-forge
    theano:        1.0.4-py36h6538335_1000 conda-forge
    vs2015_win-64: 14.0.25420-h55c1224_11

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(py36) C:\Users\Ido>set "KERAS_BACKEND="

(py36) C:\Users\Ido>python C:\Users\Ido\AppData\Local\conda\conda\envs\py36\etc\keras\load_config.py  1>temp.txt

(py36) C:\Users\Ido>set /p KERAS_BACKEND= 0<temp.txt

(py36) C:\Users\Ido>del temp.txt

(py36) C:\Users\Ido>python -c "import keras"  1>nul 2>&1

(py36) C:\Users\Ido>if errorlevel 1 (
ver  1>nul
 set "KERAS_BACKEND=theano"
 python -c "import keras"  1>nul 2>&1
)

(py36) C:\Users\Ido>SET DISTUTILS_USE_SDK=1

(py36) C:\Users\Ido>SET MSSdk=1

(py36) C:\Users\Ido>SET platform=

(py36) C:\Users\Ido>IF /I [AMD64] == [amd64] set "platform=true"

(py36) C:\Users\Ido>IF /I [] == [amd64] set "platform=true"

(py36) C:\Users\Ido>if defined platform (set "VSREGKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0" )  ELSE (set "VSREGKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0" )

(py36) C:\Users\Ido>for /F "skip=2 tokens=2,*" %A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0" /v InstallDir') do SET "VSINSTALLDIR=%B"
ERROR: The system was unable to find the specified registry key or value.

(py36) C:\Users\Ido>if "" == "" (set "VSINSTALLDIR=" )

(py36) C:\Users\Ido>if "" == "" (
ECHO "WARNING: Did not find VS in registry or in VS140COMNTOOLS env var - your compiler may not work"
 GOTO End
)
"WARNING: Did not find VS in registry or in VS140COMNTOOLS env var - your compiler may not work"
The system cannot find the batch label specified - End
@minhdvo
Copy link

minhdvo commented Aug 21, 2019

I met a similar problem even though I still can use python and other packages.
I guess it could be related to administration permission. Because this problem occurred after installation and beginning the verification process for installing keras. Any suggestion?

@dmariko-yseop
Copy link

It seems to be calling the compiler from VS 2015 (version 14), exclusively ?

@RobeeF
Copy link

RobeeF commented Aug 29, 2019

Same error for me. I still can use Python but I am not able to launch Spyder anymore

@sidney-cardozo
Copy link

I am having the same issue, has anyone else found a work around? @dmariko-yseop were able you selectively install VS 2015 version 14 and then get it to install?

@g3n3ralb3n-wp
Copy link

This even happens when you try and just install theano without keras.

@nocluebutalotofit
Copy link

Same issue here as well.

@ryokugyu
Copy link

Any solution for this? I am also facing the same issue.

@omarmaree
Copy link

same problem with me. Please any solution?

@MathCau
Copy link

MathCau commented Sep 28, 2019

Hi!
Not sure exactly what worked but here is what I did :

  • DL VC tools

  • set VSINSTALLDIR = C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools in my environment variable

  • run on anaconda prompt the command :
    conda install -c conda-forge/label/broken keras
    cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
    vcvarsall.bat

  • open Spyder and run : from keras.models import Sequential

  • got the console :

In [1]: """
Éditeur de Spyder

Ceci est un script temporaire.
"""

from keras.models import Sequential
Using TensorFlow backend.

In [2]:

I guess it worked and the issue was the VSINSTALLDIR not being initialised in my environment variable

@amanrs
Copy link

amanrs commented Oct 24, 2019

well this was what worked for me

conda remove keras

and then install backend engines like TensorFlow, Theano, or CNTK if you haven't

pip install tensorflow

then install keras

pip install keras

@naomifridman
Copy link

same issue. some things are working, but I get strange cuda errors

@amanrs
Copy link

amanrs commented Oct 26, 2019

@naomifridman did you install Cuda from vscode terminal?

@omarmaree
Copy link

I solved the problem by doing a factory reset to my pc in order to uninstall cuda, cudnn, vs2015 cause there was a conflict between versions. then, i installed python3.6 ,VS2017 with VC++2015 TOOLSET, CUDA10.0 and Cudnn7.4.1.

@rzsgrt
Copy link

rzsgrt commented Nov 4, 2019

EDIT:
Previously i have this warning message and i have vs2015 runtime and vs 2015 win-64 in my library.
After i update keras, vs2015 win-64 removed and no more warning message.
Here's my system
OS : win10
conda 4.7.12
python 3.7 (previously 3.6, forgot when they update my python)
keras 2.2.4 (cpu)

@sandysd99
Copy link

try update your conda by:- conda update -n base -c defaults conda

@dian-ai
Copy link

dian-ai commented Dec 30, 2019

this video explains a very simple way: only go for some commands
https://www.youtube.com/watch?v=MIkZ6cDE53w

1- conda create --name deeplearning
2- activate deeplearning
3- conda install -c anacoda keras

4-conda install jupyter
5-conda install spyder
6- conda install matplotlib
7- conda install pandas

@educatedguessing
Copy link

I just had the same issue.
Unfortunately installing or updating VS did not help. Installing tensorflow and keras using pip did work, but conda and pip do not always go well together..
In the end, running
conda install tensorflow
conda install -c conda-forge/label/broken keras
got me a working keras env.

OS: windows 10
conda: 4.8.1
python: 3.7.6

@robisen1
Copy link

robisen1 commented Feb 2, 2020

This even happens when you try and just install theano without keras.

I have the same issue but i did not install theano. rather i already installed tensorflow and got the same issue when i installed keras

@OrbitPodium
Copy link

Close Anaconda Navidator and kill python running process.
run conda install -c anaconda keras from Anaconda prompt as administrator and the installation goes success

@Ke-V25
Copy link

Ke-V25 commented Feb 10, 2020

Close Anaconda Navidator and kill python running process.
run conda install -c anaconda keras from Anaconda prompt as administrator and the installation goes success

Thanks
That worked for me

@AKhileshPothuri
Copy link

simple pip install keras worked for me

@rkumar399
Copy link

I am able to solve this issue after installing VS 2015 and also C# Tools which is part of VS2015 is needed for vcvarsall.bat, C# is not part of default installation. Below urls can be used to download VS 2015 community edition.

https://stackoverflow.com/questions/44290672/how-to-download-visual-studio-community-edition-2015-not-2017
https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409
https://go.microsoft.com/fwlink/?LinkId=615448&clcid=0x409

@mlduarte
Copy link

mlduarte commented Mar 4, 2020

as per comment from @dian-ai, using conda install -c anacoda keras instead of conda install -c conda-forge keras fixed the issue for me

@barthelemymp
Copy link

https://stackoverflow.com/questions/57082951/anaconda-installation-error-the-system-was-unable-to-find-the-specified-regist

This solution worked for me

@rponweb
Copy link

rponweb commented May 14, 2020

launch Anaconda navigator-->under environments tab --> select uninstalled from the dropdown--> then search for the installed Visual studio version VS and enable it.. apply and exit
then try reinstall teraflow and keras from command..
should work

@fnandocontreras
Copy link

installing keras from anaconda prompt worked for me, i was running into the problem while using powershell in windows10

@MarkLobo
Copy link

MarkLobo commented Jul 4, 2020

For what is worth I had the same problem installing Keras in Anaconda. I installed TensoFlow and then Keras, in PyCharm, which was using the same Anaconda Enviroment

@yuvaraj-k
Copy link

well this was what worked for me

conda remove keras

and then install backend engines like TensorFlow, Theano, or CNTK if you haven't

pip install tensorflow

then install keras

pip install keras

this worked for me. thanks for sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests