Hey guys. I’ve just installed Maya 2022 and I really hoped that they finally listened to us and that Maya’s Python 3.7 would be built with the same version of Visual Studio as vanilla Python 3.7, but looks like they really don’t want to make this any easier for us, even after 7 years. So, I was wondering if anyone has started building packages for Python 3.7 with VS 2015 and shared it somewhere? I am interested in NumPy, SciPy, Pandas, OpenCV, and maybe some AI packages. Looks like some functionalities from packages build with VS 2017 work in Maya 2022, but because I develop massive tools/Apps with 500+ modules I found that all of these packages crash at some point. Well, obviously they do, they are built with newer version of VS.
I am pretty sure you can pip install any py37 packages using mayapy.exe:
If a compiled module doesn’t work with your interpreter it won’t import, so if it is crashing the issue is else where as that implies it has already imported?
I could even import some python packages built with VS 2008 in previous Maya versions with Python 2.7 built with VS 2015, so I don’t think valid import is a significant indicator that this doesn’t cause issues. Python 3.7 in Maya 2022 is built with VS 2015 and installed packages via pip are built with VS 2017 and that is not a small issue. This will cause a lot of bugs for a lot of programmers. Weird thing is that a lot of things actually work. This is probably the case because there are not as big differences between C++ compilers in VS 2015 and VS 2017 as there were between VS 2008 and VS 2015. Anyway I have a couple of backends for my tools, Maya (2.7), Maya(3.7), OpenGL(3.7) and Qt(3.7) and Maya(3.7) crashes always inside packages, mostly NumPy and OpenCV which implies there are some incompatibilities caused probably by compiler. These bugs don’t exist in vanilla Python with different backends. The biggest issue I have right now is that I can’t even find VS 2015 and C++ Build Tools so I can’t even build these packages now. Damn, always headaches with Python packages…
That is bonkers… They standardised 3DsMax Py3 so it works with compiled pip packages, I wonder why they didn’t with Maya and why it is alluded to pip working in the docs…
Did a Google and found this:
Might be helpful even if it is for PyQt5.
Also, VS2015 build tools:
I don’t know why they didn’t do it with Maya.
My Vanilla Python says: 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]
and Maya’s Python 3.7: 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)], so same version of Python but Vanilla Python is built with VS 2017 and Maya’s Python is built with VS 2015.
What platform are you on? I have no issues importing numpy (vanilla pypi version) in Maya 2022.
For me on Windows, Maya 2022 reports
>>> sys.version 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC v.1900 64 bit (AMD64)]
And vanilla Python also reports
>>> sys.version 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
I realise I’m comparing 3.7.7 vs 3.7.9 but Python guarantees ABI compatibility across point releases, so that should be irrelevant.
Hm, I got MSC v.1916 with 3.7 on my second laptop also. However, if You get 1900 with 3.7 that is promising. I think I will be able to find that version then. Thanks!