I'm trying to build a simple C++ extension module for Blender through their Python API which, as of the latest version, is 3.5.3 (to my knowledge, one cannot change this). Python 3.5.3 is compiled with MSC v.1800 (i.e., Visual Studio 2013 version 12.0).
I have both Visual Studio 2013 and Visual Studio 2017 installed. When running distutils.setup(...)
in my "setup.py" for the extension, it invariably finds only Visual Studio 2017, causing the build to fail (one must match the Visual Studio version to the Python version [1] ).
How can I convince distutils.setup(...)
to find the Visual Studio corresponding to the Python that's running?
I tried prepending the Visual Studio 2013 path to the PATH
, which does nothing. I also dug into "Lib/distutils/" to try to figure it out, but couldn't (looks like it's registry-based, not PATH
-based).
[1] Or else, one gets the mysterious, undocumented error LNK1327: failure during running rc.exe
. This is the entire error, though there is also a minor warning before it, which is apparently normal.