Closed AmberElferink closed 1 year ago
Hi @AmberElferink, what is the output of vswhere
when you run it manually with the same flags used by setuptools?
(e.g.
vswhere -latest -prerelease -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -products *
vswhere -latest -prerelease -requires Microsoft.VisualStudio.Workload.WDExpress -property installationPath -products *
)
Hi @abravalheri, Thanks for picking it up so quickly. Both of those commands return empty
Hi @AmberElferink, I think you need to ensure your installation contains either Microsoft.VisualStudio.Component.VC.Tools.x86.x64
or Microsoft.VisualStudio.Workload.WDExpress
(these seem to be the components setuptools depends to be able to compile the code).
Can you tell me how I can get these? I did install the packages I mentioned at the top of the post. Is there somewhere else I should be looking for?
If you already tried to download https://visualstudio.microsoft.com/visual-cpp-build-tools/ (link in the error message) and it failed, I am not sure how else you can obtain it...
Maybe you need to select the option with "C++" in the installers' GUI related to Workload?
If you already are doing that and vswhere
keeps returning an empty result for the commands above maybe the best would be asking the maintainers of vswhere (probably https://github.com/microsoft/vswhere?)
Thanks, indeed I selected the full C++ package in Visual Studio 2019 now and then it was able to find it. A bit over the top, but if it works, it works :)
setuptools version
68.0.0
Python version
3.8.17
OS
Windows 11
Additional environment information
I installed Visual Studio 2019 and 2022. In both 2019 and 2022 I installed MSVC v140 - VS 2015 C++ build tools (v14.00) AND MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.29-16.10) AND (in 2022): MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.37-17.7)
Example:
Description
Compiling a default hello world script with setuptools in python gives an error not recognizing MSVC build tools, while the build tools are installed for all visual studio versions.
Expected behavior
I expect the script to see the Build Tools I installed correctly.
How to Reproduce
Output
The error I get is:
I tried to find out where it is coming from, so put some prints in the msvc.py of the setuptools package (which are the FANCY PATH prints in the error above):
It seems vswhere.exe is spitting out no result.
Note, there also is a Visual Studio 14.0 folder on my PC (related to Visual Studio 2015), from which is the cl.exe is apparently running right now. If that folder is deleted, it gives:
Running vswhere.exe manually gives:
So vswhere does show some Build Tools for 2022 installed, but apparently they are not correctly seen as output by the python script? Can this be fixed?