Numpy not working in maya

47 views
Skip to first unread message

Daniel Sanchez

unread,
Apr 19, 2013, 8:45:55 AM4/19/13
to python_in...@googlegroups.com
Hi!! First post here!!


Im currently triying to install numpy on maya 2013 x64, and Im getting mad.... :(


I've been searching for a solution but nothing have worked:

import numpy
# Error: DLL load failed: A dynamic link library (DLL) initialization routine failed.
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# File "C:\Program Files\Ilion\IlionMayaFramework\2013\ilion_maya_framework\shared\bin\site-packages\numpy\__init__.py", line 154, in <module>
# import add_newdocs
# File "C:\Program Files\Ilion\IlionMayaFramework\2013\ilion_maya_framework\shared\bin\site-packages\numpy\add_newdocs.py", line 9, in <module>
# from numpy.lib import add_newdoc
# File "C:\Program Files\Ilion\IlionMayaFramework\2013\ilion_maya_framework\shared\bin\site-packages\numpy\lib\__init__.py", line 4, in <module>
# from type_check import *
# File "C:\Program Files\Ilion\IlionMayaFramework\2013\ilion_maya_framework\shared\bin\site-packages\numpy\lib\type_check.py", line 8, in <module>
# import numpy.core.numeric as _nx
# File "C:\Program Files\Ilion\IlionMayaFramework\2013\ilion_maya_framework\shared\bin\site-packages\numpy\core\__init__.py", line 5, in <module>
# import multiarray
# ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. #


I've read something about that maya python is compiled with vs2010 and numpy for python2.6 needs vsc71, I've also tried to install numpy for python2.7 but neither is working.

Do anyone have a clue about it?

Thanks for all in advance!!!

Ravi Jagannadhan

unread,
Apr 19, 2013, 1:55:29 PM4/19/13
to python_in...@googlegroups.com
I had these issues too, are you running Maya 64 bit? I think numpy is only 32-bit.



--
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 python_inside_m...@googlegroups.com.
To post to this group, send email to python_in...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan

Daniel Sanchez

unread,
Apr 19, 2013, 1:58:24 PM4/19/13
to python_in...@googlegroups.com
Yes, It is maya x64, and I`ve tried the numpy for 64x precompiled I finded over numpy web....
Any clue??

Thanks


2013/4/19 Ravi Jagannadhan <enr...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/xj6JiJhP91s/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.

Ravi Jagannadhan

unread,
Apr 19, 2013, 2:00:18 PM4/19/13
to python_in...@googlegroups.com
No, sorry. If you do get this working though, please let us know.

Mike Malinowski (LIONHEAD)

unread,
Apr 19, 2013, 2:03:02 PM4/19/13
to python_in...@googlegroups.com

All the standard Numpy binaries for Python 2.6 and 2.7.3 are both compiled with VS2008. As Maya’s python was compiled against VS2010 you also need a version of Numpy that is compiled against VS2010. Its probably unlikely you’ll find a pre-compiled installer compiled against that as its not standard to have Python 2.6/2.7 compiled against VS2010.

 

The only solution is to try and build Numpy yourself from source, though I think Numpy has quite a few dependencies so may not be the easiest to compile.

 

Mike.

Daniel Sanchez

unread,
Apr 19, 2013, 2:06:05 PM4/19/13
to python_in...@googlegroups.com
Ok, I've been thinking about it so maybe I'll try and compile it.

Thanks!!!

Mathew Schwartz

unread,
Apr 20, 2013, 10:14:00 PM4/20/13
to python_in...@googlegroups.com
Directions for doing this, although i never got around to do it myself: 

"In order to instal numpy, you will need to do the following:

a) Edit distutils/msvc9compiler from python2.6.zip to add a ld_args.append('/MANIFEST') line 
         (Solution found on Google... This is probably due to Maya shipping a version of distutils that pre-dates MSVC 2010.) 
b) Distutils was looking in the wrong path for Python's includes and libraries, so you need to manually copy them to the correct location (under runtime/Python/include and runtime/Python/libs) 
c) Python2.6.lib didn't have read permissions. You have to manually set them. 

d) It seems that we might have modified the file pyconfig.h in a non-standard way. Pyconfig.h indicates the python library provides replacement functions for asinh, acosh, atanh and log1p and yet, the python2.6.dll does not export such symbols leading to linking errors when compiling numpy. 
  
Extract from Maya's provided pyconfig.h: 
// Maya doesn't like a couple of these, as we have our own 
//typedef int pid_t; 
  
/* Define to 1 if you have the `log1p' function. */ 
#define HAVE_LOG1P 1 
/* Define to 1 if you have the `acosh' function. */ 
#define HAVE_ACOSH 1 
/* Define to 1 if you have the `asinh' function. */ 
#define HAVE_ASINH 1 
/* Define to 1 if you have the `atanh' function. */ 
#define HAVE_ATANH 1 
  
You then need to edit numpy source code to manually undefined these macros after including Maya's pyconfig.h file. You then need to recompile using VS2010sp1."


Another consideration for other modules is that there was a change of compilers,  from VS2008 sp1  to  VS2010 sp1.


On Sat, Apr 20, 2013 at 3:06 AM, Daniel Sanchez <3danim...@gmail.com> wrote:
Ok, I've been thinking about it so maybe I'll try and compile it.

Thanks!!!

Daniel Sanchez

unread,
Apr 22, 2013, 3:45:50 AM4/22/13
to python_in...@googlegroups.com
Ok, thanks for the hints.

:)
Reply all
Reply to author
Forward
0 new messages