1

I am having trouble setting up the 2017 VC++ build tools, both as standalone or installed with the VS community edition.

Specifically, everything seems installed ok, but calls to vcvarsall.bat do not work - python distutils complains:

ImportError: Building module some_module_name failed: ['distutils.errors.DistutilsPlatformError: Error executing cmd /u /c "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" x86_amd64 && set\n']
Process finished with exit code 1

when running vcvarsall.bat from cmd:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build>vcvarsall.bat x64
Das System kann den angegebenen Pfad nicht finden.
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.27
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
[vcvarsall.bat] Environment initialized for: 'x64'

("Das System kann den angegebenen Pfad nicht finden." is German for "system cannot find the path provided")

Similar for VsDevCmd.bat:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools>VsDevCmd.bat
Das System kann den angegebenen Pfad nicht finden.
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.27
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.

I could not get it to at least report which path cannot be found... Any ideas how to fix this?

Tried many reinstalls, also of different versions, (2019 - same, standalone 2017 build tools etc.)

Edit: I got full diagnostic output as suggested by @HansPassant; it is too long to paste here fully.

Note: Errors occur always after for /F ...
I found all directories listed in plaintext before the errors.
Only exception is the reg key at FEHLER: Der angegebene Registrierungsschlüssel bzw. Wert wurde nicht gefunden. ("Error: Did not find reg key or value") which indeed does not seem to exist.

>set __VSCMD_VER=

>for /F "tokens=1,2,* delims==+" %A in ('type "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.isolation.ini"') do (
if "3" GEQ "3"
 if /I "%A" == "SemanticVersion" (
if "3" GEQ "1"
 set "__VSCMD_VER=%B"
)
)
**Das System kann den angegebenen Pfad nicht finden.**


[...]

>for /F "tokens=1,2*" %i in ('reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0" /v "InstallationFolder"') DO (if "%i" == "InstallationFolder" (SET WindowsSdkDir=%~k ) )
Das System kann den angegebenen Pfad nicht finden.

[...]

 if EXIST "C:\Program Files (x86)\Windows Kits\10\include\%i\um\winsdkver.h" (
set result=%i
 if "!result:~0,3!" == "10." (
set SDK=!result!
 if "!result!" == "" set findSDK=1
)
)
)
Das System kann den angegebenen Pfad nicht finden.

[...]

>for /F "tokens=1,2*" %i in ('reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots" /v "KitsRoot10"') DO (if "%i" == "KitsRoot10" (SET UniversalCRTSdkDir=%k ) )
Das System kann den angegebenen Pfad nicht finden.

[...]


>for /F %i IN ('dir "C:\Program Files (x86)\Windows Kits\10\include\" /b /ad-h /on') DO (
set result=%i
 if "!result:~0,3!" == "10." set CRT=!result!
 if "!result!" == "" set match=1
)
Das System kann den angegebenen Pfad nicht finden.

[...]

>for /F %a in ('dir "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd\ext\*.bat" /b /a-d-h /on') do (call :call_script_helper ext\%a )
Das System kann den angegebenen Pfad nicht finden.

[...]


>for /F "tokens=1,2*" %i in ('reg query "HKLM\SOFTWARE\Microsoft\VisualStudio\VSPerf" /v "CollectionToolsDir"') DO (if "%i" == "CollectionToolsDir" (SET "__collection_tools=%k" ) )
Das System kann den angegebenen Pfad nicht finden.
FEHLER: Der angegebene Registrierungsschlüssel bzw. Wert wurde nicht gefunden.

[...]

>for /F %A in ('type "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt"') do (set "__VCVARS_TOOLS_VERSION=%A" )
Das System kann den angegebenen Pfad nicht finden.

[...]

>for /F %A in ('type "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\Microsoft.VCRedistVersion.default.txt"') do (set "__VCVARS_REDIST_VERSION=%A" )
Das System kann den angegebenen Pfad nicht finden.


DavidP
  • 105
  • 3
  • 12

2 Answers2

4

This seams to be a common issue for last months and there was a fix posted by Steven2105

  • Open the Registry Editor (Windows key and type regedit in the prompt)
  • Go to HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun and clear the values.
  • If it exists in HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun, delete it as well.

So run regedit.exe and delete the mentioned values to repair cmd.

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
  • 1
    Indeed had an entry there, seemingly left behind by a deinstalled anaconda-installation, which seemed to have messed up things. Thank you! – DavidP Oct 16 '20 at 13:39
  • ok, so this looks like an anaconda issue, so raise an issue on their support. The user from the other topic also used anaconda, so this is what you both have in common. – magicandre1981 Oct 16 '20 at 19:08
0

I believe the unkown path is

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\DevInit\DevInit.exe.

It exists only in

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\DevInit\DevInit.exe

possibly also in VS2022. The DeInit.exe digital signature shows:

‎Tuesday, ‎February ‎9, ‎2021 12:53:03 AM.

Hence it could have not been an original VS2017 file.