I needed to compile the latest Numpy and Scipy packages for Maya 2018, and decided to make them available to the community.
The packages were compiled against Visual Studio 2015 (to match 2018’s mayapy.exe) with Intel’s MKL libraries. I make no claim of backwards compatibility, but both packages seem to import fine in previous versions of 64 bit Maya all the way to 2014.
Do you know of any guides online that could help me learn how to do this myself? I would like to be able to build the newest version of Numpy and Scipy for Maya 2018 but installing them through pip doesn’t seem to work.
You’ll need to lookup the process of building them from source.
And substitute Maya’s python interpreter mayapy.exe for any references to python itself.
You’ll also need to use the proper version of Visual Studio while doing this, if we’re talking Maya 2018, that would be VS2015.
I’ve looked into Scipy in the past, it is very complex.
Out of curiosity, what are the features present in numpy 1.15.2 you want to leverage?
The reason packages that specifically include .pyd files (python .dll’s) downloaded with pip don’t work with Maya 2018 is because the .pyd’s were compiled with a different environment. Maya 2018 is built with Visual Studio 2015 64bit. Whereas the standard Python 2.7 distribution (and all packages containing .dll’s available through pip) are build with Visual Studio 2008 32 bit.
Because of this building numpy is not easy. Every version of numpy seems to have its own gotchas. There are a lot of dependencies you need to configure (ex: Intel’s MKL libraries). And you need to modify some of Python’s source packages, namely distutils, to get it to build with the right version of Visual Studio.
I want to improve our script for matching an IK spline rig to an FK joint pose with out creating a new curve in Maya. I needed a library to fit cubic curves to points in space and I know SciPy has some libraries for that. If I’m going to use SciPy I need to get it deployed with our tools and make sure I know how to build new versions when we upgrade Maya. It’s a lot of work for a small problem so I’ve given up on it for now.
Eric, thanks for your hard work on getting Numpy and other stuff to work in Maya - this is very very valuable. It would be great if you could make a step by step tutorial on how to build these libs independently.
I see! I think I got it to work for now! I used the compiled versions Eric Vignola put up (THANKS) and extracted them in my Maya’s C:\Program Files\Autodesk\Maya2018\Python\Lib\site-packages folder. From what I can tell it works. I WILL nedd to see how to get this all running on my own, but for now it’s okay!
But basically you need to setup your dev environment using the proper version of MSVC, you then need to put together the various parts of the toolchain and dependencies, and then finally build numpy.
I’ll try that out once I find the time. I’m happy that it works for now. I alsow managed to install the .whl file (I THINK the help was from a post you made on the maya python mailing list )
Get pip to run on MayaPY: form an elevated command prompt navigate to oyur \bin folder (where mayapy lies) and run : mayapy -m ensurepip