maya2105 - windows8 - numpy/scipy

103 views
Skip to first unread message

zoshua

unread,
Jan 10, 2015, 11:47:51 PM1/10/15
to python_in...@googlegroups.com
Hi Everyone,

I was wondering if anyone has gotten this working just yet.
I am attempting to use scipy and i am getting tripped up on the numpy import.
I have attempted to import 64 bit builds of the numpy/scipy stack via anaconda, winpython, and even building my own python27 w/ visual studio express 2012 w/ no luck.
No matter what I have done I keep getting this error.

# Error: DLL load failed: %1 is not a valid Win32 application.
# Traceback (most recent call last):
#   File "<maya console>", line 1, in <module>
#   File "C:\Anaconda\Lib\site-packages\numpy\__init__.py", line 185, in <module>
#     from . import add_newdocs
#   File "C:\Anaconda\Lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
#     from numpy.lib import add_newdoc
#   File "C:\Anaconda\Lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
#     from .type_check import *
#   File "C:\Anaconda\Lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
#     import numpy.core.numeric as _nx
#   File "C:\Anaconda\Lib\site-packages\numpy\core\__init__.py", line 6, in <module>
#     from . import multiarray
# ImportError: DLL load failed: %1 is not a valid Win32 application. # 

All the google'ing so far points to incompatible builds between 32/64, however none of the solutions for other folks have worked for this particular issue.
...
Please let me know if any one has some insight or suggestions on this one.

Thanks,

+josh





zoshua

unread,
Jan 15, 2015, 7:49:30 PM1/15/15
to python_in...@googlegroups.com
So I was able to run the build/install w/ the help of the super generous Christoph Gohlke.

I wanted to share w/ the group as none of this is really documented anywhere from start to finish, let alone for mayapy.

Here is basically what I had to do...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

For Maya 2015

Install MS Visual Studio 2012 SP4


Install Intel MKL and Fortran (a version that is compatible with aforementioned version of Visual Studio).

Intel® Parallel Studio XE Cluster Edition for Windows (2012)


To compile numpy, create a site.cfg file in numpy's source directory with the following or similar content:


[mkl]

include_dirs = C:/Program Files (x86)/Intel/Composer XE/mkl/include

library_dirs = C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64;C:/Program Files (x86)/Intel/Composer XE/compiler/lib/intel64

mkl_libs = mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_intel_thread,mkl_core,libiomp5md,libifportmd

lapack_libs = mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_intel_thread,mkl_core,libiomp5md,libifportmd


Also patch .\numpy-1.9.1\numpy\core\setup.py

   #mathlibs_choices = [[], ['m'], ['cpml']] #BEFORE

   mathlibs_choices = [[], ['cpml']] #AFTER



On a command prompt in the numpy (and then scipy) source directory, initialize Visual Studio and Intel compilers and then build numpy/scipy, e.g.:



# numpy (assuming exists in c:\numpy_scipy_build\numpy-1.9.1)

# from a new admin cmd prompt

# run the following


cd c:\numpy_scipy_build\numpy-1.9.1

rd /S /Q build

"C:\Program Files (x86)\Intel\Composer XE\bin\iclvars.bat" intel64 vs2010

"C:\Program Files (x86)\Intel\Composer XE\bin\ifortvars.bat" intel64 vs2010

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" amd64

set DISTUTILS_USE_SDK=1

set INCLUDE=%INCLUDE%;"C:\Program Files\Autodesk\Maya2015\include\python2.7";C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include

set LIB=%LIB%;"C:\Program Files\Autodesk\Maya2015\lib";C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include


"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py build

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py install



# scipy (assuming exists in c:\numpy_scipy_build\scipy-0.14.1)

# from a new admin cmd prompt

# run the following


cd c:\numpy_scipy_build\scipy-0.14.1

rd /S /Q build

"C:\Program Files (x86)\Intel\Composer XE\bin\iclvars.bat" intel64 vs2010

"C:\Program Files (x86)\Intel\Composer XE\bin\ifortvars.bat" intel64 vs2010

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" amd64

set DISTUTILS_USE_SDK=1

set INCLUDE=%INCLUDE%;"C:\Program Files\Autodesk\Maya2015\include\python2.7";C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include

set LIB=%LIB%;"C:\Program Files\Autodesk\Maya2015\lib";C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include;"C:\Program Files\Autodesk\Maya2015\Python\Lib\site-packages\numpy\core\lib"


"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py build

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py build

"c:\Program Files\Autodesk\Maya2015\bin\mayapy.exe" setup.py install


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

This was tested w/ nose in a mayapy.exe prompt
###########
import numpy
numpy.test()

import scipy
scipy.test()
###########

Hope this helps anyone else who wants some fancy numpy/scipy in maya2015

Thanks,

+josh
Reply all
Reply to author
Forward
0 new messages