-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msvc.py fails with VS 2019 Build Tools 14.24 #2028
Comments
Just hit this as well. I think it has to do with the numbering scheme for visual, which now has hundreds and not just tens, where the format string for vc_base uses And in more detail: there is a numbering scheme to get from a msvc compiler version to a visual studio version number. Versions up to So if you compile python yourself, you will no longer be able to build c-extension modules. |
Thanks for the reply, Actually I'm trying to compile pywin32 module and using python 3.8 64bit, do I should use cpython or what? |
You could run the build from within the Visual Studio Command Prompt, which will set things up so python does not have to discover which compiler to use. |
You mean I can compile and build a python package using Visual Studio same as running "setup.py build"? If yes، do you know where I can find instructions? |
Start -> Visual Studio -> Visual Studio Command Prompt will open a DOS command window with PATHs already set up for compilation. Python should respect that and just compile your code. |
Thanks for the help man, I'll check and update |
Is the fix for this issue simply to replace |
Looking at the codebase, the presence of |
I've installed the latest build tools for VC 2017 and 2019: And I believe I was able to replicate the failure:
|
It does look like some discovery is working:
|
The patched msvc14 function works as intended:
|
So although I was able to replicate the error, I'm not sure invoking Can someone help with a minimal reproducer - a project that fails to build with MSVC 14.24 or 14.25 installed? |
I cannot reproduce this error with Python 3.7 Source: Build log:
|
Not sure if this is related, but the nightly builds of our cython module stopped working after GitHub Actions updated from MSVC 14.25.28610 to MSVC 14.26.28801. |
Getting quite a lot of people running into this error the past months. The magic checkbox seems to be: |
Fresh install on a build VM. I get the same issue where msvc9_query_vcvarsall complains it cannot find the 2019 build tools in that /14.2/ folder which of course doesn't exist. |
Was able to fix this issue after some debugging by adding to registry: [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.2\Setup\VC] |
I ran into a similar problem on Python 3.10 still in 2023. None of the suggestions above worked. I did have to fix two things unrelated to Python itself to get my stuff to build with MSVC. While the path discovery worked, it was crashing in
My real dev setup using VS Code + Git Bash did not work before the fix above, but now seems to work (for now). |
Hi,
I installed VS 2019 with Build Tools 14.24 but my "setup.py build" still fails with the below error in msvc.py file:
error: Microsoft Visual C++ 14.1 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
And AFAIK, the msvc.py should support Build Tools 14.24
What I'm missing? anyone could help?
The text was updated successfully, but these errors were encountered: