[GUIDE] How to install numpy+scipy in Maya Windows 64 bit


#1

I’ve seen a lot of queries about getting scipy working in Maya (Windows 64 bit) with a few not 100% reproducible answers.

So after a long personal struggle with the problem, here’s my solution which will hopefully end the madness for all Windows Maya users:

TL;DR version

Click here to grab Maya 2014-2015-2016 tested versions of numpy ,scipy, numexpr and other useful packages…

unzip them somewhere relevant to PYTHONPATH. Congratulations! You can now use scipy in all it’s glory!

Long version

What you need is a fully functional 64 bit Python interpreter. Once installed you can then use PIP to install properly packaged Python wheels.

Python wheels are awesome because they don’t require compilers to install C extensions. Unfortunately the current standard distributions are not compiled in a way that plays nice with mayapy. However, there are developers out there who have made custom wheels which will suit our needs. The ones I used are made by "carlkl ", a dev I’ve yet to directly contact to shower him with praise.

His builds use OpenBLAS, which I haven’t benchmarked against builds made with Intel MLK, but they work fine for my needs and, I presume, most Maya users out there. To get the packages, find your new version of PIP you just installed (mine is at “C:\Python27\Scripts\pip.exe”) and run these two commands:

pip install -i https://pypi.anaconda.org/carlkl/simple numpy
pip install -i https://pypi.anaconda.org/carlkl/simple scipy

Once PIP has installed both packages you can either point mayapy’s PYTHONPATH to where PIP installed the packages, or copy them to “C:\Program Files\Autodesk\Maya20XX\Python\Lib\site-packages” or whatever location you keep your python modules. DO GRAB BOTH PACKAGES and don’t mix and match scipy with a different builds of numpy or it will complain about DLL linking errors.

Congratulations, you’re ready to rock!


#2

I edited the guide as the special build of python i mentioned is only a requirement when building something from scratch.


#3

very helpful, thank you!


#4

Nicely done and very informative. Thanks for the info.

David


#5

I’m a little late to the game, but wanted to try out numpy.
I’m using Maya x64 2017 though this was written for 2014?
However for the life of me I can’t seem to get it working. Installed Python 2.7, using the command interpreter I downloaded the numpy package and added “PYTHONPATH = C:\Program Files\Python27\Lib\site-packages” to maya.env.

So far so good, but when I tried to import it, I got this error:
# Error: ImportError: file C:\Program Files\Python27\Lib\site-packages
umpy\core_init_.py line 6: DLL load failed: %1 is not a valid Win32 application. #

What is it that I don’t understand. What application is not a valid Win32 one?