gpt4 book ai didi

python - 安装 Visual Studio 19 时找不到 Visual Studio 17

转载 作者:行者123 更新时间:2023-12-04 09:13:22 25 4
gpt4 key购买 nike

我使用的是 win 10、Anaconda 4.8.3 和 Python 3.7.4。在 C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools 下我有 SDK。以下是我看到的文件夹:

enter image description here

安装 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,但没有任何效果。非常感谢任何帮助。

最佳答案

我遇到了同样的问题。好像跟Theano有关。对我来说,我解决了它

> conda uninstall tensorflow theano
> conda install -c anaconda tensorflow

如果我安装例如引入theano的pymc3,我又遇到了同样的问题。

关于python - 安装 Visual Studio 19 时找不到 Visual Studio 17,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63311955/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com