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 (like numexpr!). 
<https://drive.google.com/folderview?id=0BwsYd1k8t0lEfjJqV21yTnd2elVhNXEyTXhHclhxbDhvWVF5WWZUeVFISWViaFh1TzhrNTQ&usp=sharing>

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 Python interpreted compiled with 
MSVC2010. The steps for how to do that can be found here 
<http://p-nand-q.com/python/building-python-27-with-vs2010.html>. 
Fortunately, the author not only explains the steps for how and why doing 
this is a good idea, but also provides pre-built binaries which is really 
nice of him. So go ahead and download the 2.7.10 64bit build 
<http://p-nand-q.com/python/2015.07.12-Python2710-x64.7z> and unzip it 
somewhere (I put mine here: "C:\Python27"). You can use PIP to install a 
properly packaged Python wheels which should play nice with mayapy.

Python wheels <http://pythonwheels.com/> are awesome because when properly 
packaged they don't require compilers to install C extensions. 
Unfortunately our new version of Python isn't part of the standard 
distribution, so existing "official" numpy and scipy wheels won't work for 
us. However, there are developers out there who have made custom wheels 
which will suit our needs. The one I used is made by "*carlkl 
<https://anaconda.org/carlkl>*", a dev I've yet to directly contact to 
shower him with praise.

His builds  <https://anaconda.org/carlkl>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!

Quick disclaimer: I recently noticed that running numpy.test() and 
scipy.test() *does* make mayapy crash, and i'm not entirely certain why but 
I do suspect it is benign. I've been using this build of scipy heavily in 
our tools and it's been stable and happy.


Cheers everyone!

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/6ad7747e-136f-4398-8c8e-36f4bf8cb5d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to