4

I am a newbie to the anaconda environment. A couple of days back I installed keras and tensorflow through anaconda prompt. tensorflow installed successfully but keras didn't. After, whenever I open the terminal the following error is showing. Please help me out.

my installation commands are:

conda create -n tf tensorflow

conda install -c conda-forge keras
C:\Users\venkatesh>SET DISTUTILS_USE_SDK=1

C:\Users\venkatesh>SET MSSdk=1

C:\Users\venkatesh>SET "VS_VERSION=15.0"

C:\Users\venkatesh>SET "VS_MAJOR=15"

C:\Users\venkatesh>SET "VS_YEAR=2017"

C:\Users\venkatesh>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"

C:\Users\venkatesh>set "MSYS2_ENV_CONV_EXCL=CL"

C:\Users\venkatesh>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"

C:\Users\venkatesh>set "CXX=cl.exe"

C:\Users\venkatesh>set "CC=cl.exe"

C:\Users\venkatesh>set "VSINSTALLDIR="

C:\Users\venkatesh>for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -version [15.0,16.0) -property installationPath`) do (set "VSINSTALLDIR=%i\" )

C:\Users\venkatesh>if not exist "" (for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -requires Microsoft.VisualStudio.Component.VC.v141.x86.x64 -property installationPath`) do (set "VSINSTALLDIR=%i\" ) )

C:\Users\venkatesh>if not exist "" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" )

C:\Users\venkatesh>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" )

C:\Users\venkatesh>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\" )

C:\Users\venkatesh>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\" )

C:\Users\venkatesh>IF NOT "" == "" (
set "INCLUDE=;"
 set "LIB=;"
 set "CMAKE_PREFIX_PATH=;"
)

C:\Users\venkatesh>call :GetWin10SdkDir

C:\Users\venkatesh>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 exit /B 1

C:\Users\venkatesh>exit /B 0

C:\Users\venkatesh>for /F %i in ('dir /ON /B "\include\10.*"') DO (SET WindowsSDKVer=%~i )
The system cannot find the file specified.

C:\Users\venkatesh>if errorlevel 1 (echo "Didn't find any windows 10 SDK. I'm not sure if things will work, but let's try..." )  else (echo Windows SDK version found as: "" )
Windows SDK version found as: ""

C:\Users\venkatesh>IF "win-64" == "win-64" (
set "CMAKE_GEN=Visual Studio 15 2017 Win64"
 set "BITS=64"
)  else (
set "CMAKE_GEN=Visual Studio 15 2017"
 set "BITS=32"
)

C:\Users\venkatesh>pushd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
The system cannot find the path specified.

C:\Users\venkatesh>CALL "VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.16
The system cannot find the path specified.

C:\Users\venkatesh>popd

C:\Users\venkatesh>IF "" == "" SET "CMAKE_GENERATOR=Visual Studio 15 2017 Win64"

C:\Users\venkatesh>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1

C:\Users\venkatesh>if errorlevel 1 exit /B 1

C:\Users\venkatesh>exit /B 0
Axe319
  • 4,255
  • 3
  • 15
  • 31
Venkatesh
  • 43
  • 5
  • Does [this](https://stackoverflow.com/a/58944276/14290681) answer your question? –  Nov 09 '20 at 17:14
  • sorry, don't know. Now i have changed os from windows to ubuntu – Venkatesh Nov 17 '20 at 14:36
  • Ok, Is your issue resolved now ? I mean are you able to import `tensorflow` and `keras` on Ubuntu? From `tensorflow 2.3` onwards `keras` are integrated with `tensorflow`. You can simply call module `tf.keras'. For more details please refer [this](https://www.tensorflow.org/api_docs/python/tf/keras). Thanks! –  Nov 17 '20 at 15:34
  • Sorry, till now i haven't started using keras in ubuntu. A couple of days back came to ubuntu. Thanks for admitting it. – Venkatesh Nov 19 '20 at 10:27

2 Answers2

1

I had a similar set of errors created by theano, which a package of interest required.

conda uninstall theano and the error was gone.

If you need to use theano, I recommend making a new conda environment and isolating it there.

John Stud
  • 1,506
  • 23
  • 46
0

I was trying to create a virtual environment in anaconda for a very old version of tensorflow=1.3.0 and keras=2.0.9, and I got the similar error above after using conda install -c conda-forge keras==2.0.9.

conda uninstall theano 
conda uninstall -c conda-forge keras==2.0.9 (but Proceed ([y]/n)? n ---select no)
pip install keras == 2.0.9  

solves the problems, and Tensorflow, Keras runs properly now.

Xing
  • 11
  • 1
  • 3