我正在使用win 10和Anaconda 4.8.3以及Python 3.7.4。在C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools下,我有SDK。以下是我看到的文件夹:
安装keras(conda install -c conda-forge keras)后,我开始遇到问题。我更新了anaconda,但每次打开anaconda的cmd提示符时,我都会看到以下错误:C:\Users\MyName>python C:\Users\MyName\Anaconda3\etc\keras\load_config.py 1>temp.txt
C:\Users\MyName>set /p KERAS_BACKEND= 0<temp.txt
C:\Users\MyName>del temp.txt
C:\Users\MyName>python -c "import keras" 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 (
ver 1>nul
set "KERAS_BACKEND=theano"
python -c "import keras" 1>nul 2>&1
)
C:\Users\MyName>SET DISTUTILS_USE_SDK=1
C:\Users\MyName>SET MSSdk=1
C:\Users\MyName>SET "VS_VERSION=15.0"
C:\Users\MyName>SET "VS_MAJOR=15"
C:\Users\MyName>SET "VS_YEAR=2017"
C:\Users\MyName>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"
C:\Users\MyName>set "MSYS2_ENV_CONV_EXCL=CL"
C:\Users\MyName>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"
C:\Users\MyName>set "CXX=cl.exe"
C:\Users\MyName>set "CC=cl.exe"
C:\Users\MyName>set "VSINSTALLDIR="
C:\Users\MyName>for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -version
[15.0,16.0) -property installationPath`) do (set "VSINSTALLDIR=%i\" )
C:\Users\MyName>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\MyName>if not exist "" (set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\" )
C:\Users\MyName>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\MyName>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\MyName>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\MyName>IF NOT "" == "" (
set "INCLUDE=;"
set "LIB=;"
set "CMAKE_PREFIX_PATH=;"
)
C:\Users\MyName>call :GetWin10SdkDir
C:\Users\MyName>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 exit /B 1
C:\Users\MyName>exit /B 0
C:\Users\MyName>for /F %i in ('dir /ON /B "C:\Program Files (x86)\Windows Kits\10\\include\10.*"')
DO (SET WindowsSDKVer=%~i )
C:\Users\MyName>(SET WindowsSDKVer=10.0.18362.0 )
C:\Users\MyName>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: "10.0.18362.0" )
Windows SDK version found as: "10.0.18362.0"
C:\Users\MyName>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\MyName>pushd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
The system cannot find the path specified.
C:\Users\MyName>CALL "VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.16 10.0.18362.0
The system cannot find the path specified.
C:\Users\MyName>popd
C:\Users\MyName>IF "" == "" SET "CMAKE_GENERATOR=Visual Studio 15 2017 Win64"
C:\Users\MyName>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE 1>nul 2>&1
C:\Users\MyName>if errorlevel 1 exit /B 1
C:\Users\MyName>exit /B 0
(base) C:\Users\MyName>
我尝试更新了Anaconda,删除了用户环境变量中的一些旧路径,重启了系统,卸载并重新安装了Keras,但都没有起作用。非常感谢任何帮助。