-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
setuptools version
setuptools==67.8.0
Python version
Python 3.09, 3.10, 3.11
OS
Windows Server 2012r2
Additional environment information
No response
Description
Hi,
I encountered an error when using setup.py to compile a module related to pybind11. The error message was pybind11\detail/common.h(86): fatal error C1189: #error: pybind11 2.10+ requires MSVC 2017 or newer
. But I actually had VS2017 installed. Later, I found that the _msvccompiler.py module in setuptools seemed to be highly optimized, causing the _get_vc_env function to always return the environment variables of MSVC14. And I tried to add some print statements in that function, but nothing was printed, proving that the function was never called. Finally, I renamed _get_vc_env to _get_vc_env1, and setup.py worked fine.
I tried to print the name of the _get_env_vc function, and the actual output was “<function msvc14_get_vc_env at 0xxxxxxxx>.”, which looked like a function that was optimized for a specific compiler.
Expected behavior
setuptools can dected vs2017 environment.
How to Reproduce
- Call a python setup.py to compile c++ extension.
Output
\.py3.11\lib\site-packages\pybind11\include\pybind11\detail/common.h(86): fatal error C1189: #error: pybind11 2.10+ requires MSVC 2017 or newer