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

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 25
  • Comments: 28

Most upvoted comments

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 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

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

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

simple pip install keras worked for me