[maya] bug in maya's python bundle, oh joy

What is the best way to file a bug?

so apparently there is a string format error in their python27.zip/distutils/msvc9compiler.py at line 243:


        toolskey = "VS100COMNTOOLS" % version

so you can’t use pip very well when it come to “attempting” to compile c extensions. It raises an exception instead of continuing without the extension. Awesome!

Is there a way to tell pip never to even try extensions?

So I’m not running into that bug when using pip to compile and install pillow.

This is running with the mayapy.exe from Maya2014, and the windows 7 SDK compiler, which should be the same compiler as vs2010.
I also tried it in Maya2015 using the VS2012 compiler, and it also succeeded.

So it seems because I’ve got visual studio installed, or did enough in the past that its still in my registry, it never even gets to that chunk of code, and so I never see the bug.

That is rather annoying, having that lurk there. Especially with it in both 2014 and 2015.

It doesn’t look like there is a flag or anything to have pip skip C-Extensions.
Possibly telling it to not get dependencies with the --no-dependencies flag, and then just hand install everything.

Also I did notice that setuptools actually monkey-patches msvc9compiler to find the new microsoft python2.7 compiler.
So you might be able to setup a similar file, and just bypass the bugged one, whereas their’s falls back on the distutils version if the new 2.7 compiler isn’t found.

After installing setuptools it should be located in: Lib\site-packages\setuptools\msvc9_support.py

yes, if you have msvc installed, it works well, forgot to mention that.

i’ll check the monkey patch, thanks for finding that!

Maya 2014 along with Python for Maya has been compiled with VS2010 toolchain. It’s quite unusual, since not all pure python module can work in pair with Maya 2014 Python (because conflict of runtimes). If you want to make work properly all your custom Python modules in Maya, you have to compile them with the same toolchain, otherwise the full compatibility is not guaranteed.

[QUOTE=Styler;27237]Maya 2014 along with Python for Maya has been compiled with VS2010 toolchain. It’s quite unusual, since not all pure python module can work in pair with Maya 2014 Python (because conflict of runtimes). If you want to make work properly all your custom Python modules in Maya, you have to compile them with the same toolchain, otherwise the full compatibility is not guaranteed.[/QUOTE]

Indeed, the problem with the bug, is that without Visual Studio (or the Win7 SDK) installed you get an exception from buggy code, and not the proper response of no valid compiler found. Which makes it a lot trickier to debug / diagnose.

Worse yet is that with Maya 2015, which uses vs2012, still has “VS100COMNTOOLS % version” in the code, so in addition to being bad code, it lies to you about what version its looking for.

ok so i’m able to modify the monkey path to accept the current exception, thanks for the tip in the right direction