简体   繁体   中英

Long error messages about VSINSTALLDIR and vs2019 whenever I start Anaconda Prompt in my "base" environment

I get a very long list of Windows shell script messages dumped to the console with some embedded errors about "vs2019" every time I start an Anaconda Prompt terminal on my Windows 10 64-bit system. This appears to have started when I installed an IBM JupyterLab package Elyra Snippets into my Anaconda base environment.

I do NOT get these messages if I start an Anaconda Prompt for any of the other virtual environment available on the Windows 10 "Start" Menu.

Below are full list of script console error messages that I get. There are so many that Googling does not help, even if I just search for what appears to be the main one:

"C:\Users\richadmin>CALL c:\ProgramData\Anaconda3\etc\conda\activate.d\vs2017_get_vsinstall_dir.bat
Did not find VSINSTALLDIR
Windows SDK version found as: "10.0.19041.0"
The system cannot find the path specified.
Did not find VSINSTALLDIR"

I DO have VS2019 Community Edition installed, but it appears to be looking for VS2017.

Between the Windows console messages, vs2019 & vs2017 messages, and other embedded shell scripts, this is a big rathole that I have gone down several times trying to fix it and wasting hours each time.

############################################################

Here are all of the shell messages echoed to the console.

>     C:\Users\richadmin>SET DISTUTILS_USE_SDK=1
>     
>     C:\Users\richadmin>SET MSSdk=1
>     
>     C:\Users\richadmin>SET "VS_VERSION=15.0"
>     
>     C:\Users\richadmin>SET "VS_MAJOR=15"
>     
>     C:\Users\richadmin>SET "VS_YEAR=2017"
>     
>     C:\Users\richadmin>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"
>     
>     C:\Users\richadmin>set "MSYS2_ENV_CONV_EXCL=CL"
>     
>     C:\Users\richadmin>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"
>     
>     C:\Users\richadmin>set "CXX=cl.exe"
>     
>     C:\Users\richadmin>set "CC=cl.exe"
>     
>     C:\Users\richadmin>CALL C:\ProgramData\Anaconda3\etc\conda\activate.d\vs2017_get_vsinstall_dir.bat
>     Did not find VSINSTALLDIR
>     Windows SDK version found as: "10.0.19041.0"
>     **********************************************************************
>     ** Visual Studio 2019 Developer Command Prompt v16.9.4
>     ** Copyright (c) 2021 Microsoft Corporation
>     **********************************************************************
>     [ERROR:vcvars.bat] Toolset directory for version '14.16' was not found.
>     [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
>     [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
>     [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
>     [ERROR:VsDevCmd.bat] Where [value] is:
>     [ERROR:VsDevCmd.bat]    1 : basic debug logging
>     [ERROR:VsDevCmd.bat]    2 : detailed debug logging
>     [ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
>     [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
>     [ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
>     Did not find VSINSTALLDIR
>     
>     C:\Users\richadmin>SET DISTUTILS_USE_SDK=1
>     
>     C:\Users\richadmin>SET MSSdk=1
>     
>     C:\Users\richadmin>SET "VS_VERSION=16.0"
>     
>     C:\Users\richadmin>SET "VS_MAJOR=16"
>     
>     C:\Users\richadmin>SET "VS_YEAR=2019"
>     
>     C:\Users\richadmin>set "MSYS2_ARG_CONV_EXCL=/AI;/AL;/OUT;/out"
>     
>     C:\Users\richadmin>set "MSYS2_ENV_CONV_EXCL=CL"
>     
>     C:\Users\richadmin>set "PY_VCRUNTIME_REDIST=\bin\vcruntime140.dll"
>     
>     C:\Users\richadmin>set "CXX=cl.exe"
>     
>     C:\Users\richadmin>set "CC=cl.exe"
>     
>     C:\Users\richadmin>set "VSINSTALLDIR="
>     
>     C:\Users\richadmin>for /F "usebackq tokens=*" %i in (`vswhere.exe -nologo -products * -version [16.0,17.0) -property installationPath`) do (set "VSINSTALLDIR=%i\" )
>     
>     C:\Users\richadmin>(set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\" )
>     
>     C:\Users\richadmin>(set "VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" )
>     
>     C:\Users\richadmin>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" (for /F "usebackq tokens=*" %i in
> (`vswhere.exe -nologo -products * -requires
> Microsoft.VisualStudio.Component.VC.v142.x86.x64 -property
> installationPath`) do (set "VSINSTALLDIR=%i\" ) )
>     
>     C:\Users\richadmin>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" (set "VSINSTALLDIR=C:\Program Files
> (x86)\Microsoft Visual Studio\2019\Professional\" )
>     
>     C:\Users\richadmin>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" (set "VSINSTALLDIR=C:\Program Files
> (x86)\Microsoft Visual Studio\2019\Community\" )
>     
>     C:\Users\richadmin>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" (set "VSINSTALLDIR=C:\Program Files
> (x86)\Microsoft Visual Studio\2019\BuildTools\" )
>     
>     C:\Users\richadmin>if not exist "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\" (set "VSINSTALLDIR=C:\Program Files
> (x86)\Microsoft Visual Studio\2019\Enterprise\" )
>     
>     C:\Users\richadmin>IF NOT "" == "" (
>     set "INCLUDE=;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\winrt;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\cppwinrt;C:\Program Files (x86)\Windows
> Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\winrt;C:\Program Files (x86)\Windows
> Kits\10\include\10.0.19041.0\cppwinrt"
>      set "LIB=;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86;C:\Program Files (x86)\Windows
> Kits\10\lib\10.0.19041.0\ucrt\x86;C:\Program Files (x86)\Windows
> Kits\10\lib\10.0.19041.0\um\x86;C:\Program Files (x86)\Windows
> Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows
> Kits\10\lib\10.0.19041.0\ucrt\x64;C:\Program Files (x86)\Windows
> Kits\10\lib\10.0.19041.0\um\x64"
>      set "CMAKE_PREFIX_PATH=;"
>     )
>     
>     C:\Users\richadmin>call :GetWin10SdkDir
>     
>     C:\Users\richadmin>call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node  1>nul 2>&1
>     
>     C:\Users\richadmin>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node  1>nul 2>&1
>     
>     C:\Users\richadmin>if errorlevel 1 call :GetWin10SdkDirHelper HKLM\SOFTWARE  1>nul 2>&1
>     
>     C:\Users\richadmin>if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE  1>nul 2>&1
>     
>     C:\Users\richadmin>if errorlevel 1 exit /B 1
>     
>     C:\Users\richadmin>exit /B 0
>     
>     C:\Users\richadmin>for /F %i in ('dir /ON /B "C:\Program Files (x86)\Windows Kits\10\\include\10.*"') DO (SET WindowsSDKVer=%~i )
>     
>     C:\Users\richadmin>(SET WindowsSDKVer=10.0.10240.0 )
>     
>     C:\Users\richadmin>(SET WindowsSDKVer=10.0.18362.0 )
>     
>     C:\Users\richadmin>(SET WindowsSDKVer=10.0.19041.0 )
>     
>     C:\Users\richadmin>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.19041.0" )
>     Windows SDK version found as: "10.0.19041.0"
>     
>     C:\Users\richadmin>IF 2019 GEQ 2019 (
>     set "CMAKE_GEN=Visual Studio 16 2019"
>      IF "win-64" == "win-64" (
>     set "BITS=64"
>      set "CMAKE_PLAT=x64"
>     )  ELSE (
>     set "BITS=32"
>      set "CMAKE_PLAT=Win32"
>     )
>     )  ELSE (IF "win-64" == "win-64" (
>     set "CMAKE_GEN=Visual Studio 16 2019 Win64"
>      set "BITS=64"
>     )  else (
>     set "CMAKE_GEN=Visual Studio 16 2019"
>      set "BITS=32"
>     ) )
>     
>     C:\Users\richadmin>pushd C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\
>     
>     C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>CALL "VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.29 10.0.19041.0
>     **********************************************************************
>     ** Visual Studio 2019 Developer Command Prompt v16.9.4
>     ** Copyright (c) 2021 Microsoft Corporation
>     **********************************************************************
>     [ERROR:vcvars.bat] Toolset directory for version '14.29' was not found.
>     [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
>     [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
>     [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
>     [ERROR:VsDevCmd.bat] Where [value] is:
>     [ERROR:VsDevCmd.bat]    1 : basic debug logging
>     [ERROR:VsDevCmd.bat]    2 : detailed debug logging
>     [ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
>     [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
>     [ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
>     
>     (base) C:\Users\richadmin>

I had something similar as well. I typed conda uninstall vswhere in Anaconda prompt. The messages were gone after that.

Do look carefully at what packages will also be removed as a result, especially if you do need Visual Studio. I could do without, and hence I was able to go through with it.

'vswhere' seems to be a package that searches for where Visual Studio is located. That's why it appears to be still searching whether or not Visual Studio is actually present.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM