PDA

View Full Version : import numpy, Python module problem


misterwolfy
09-28-2010, 02:30 AM
I am having a problem with python Modules. I assume it is an environment variable issue, but have not been able to resolve yet.

for example:

import numpy

gets me:

# Error: No module named numpy
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
# ImportError: No module named numpy #

Numpy is installed at:
/Library/Python/2.6/site-packages/numpy-2.0.0.dev_20100915-py2.6-macosx-10.6-universal.egg

I'm using Maya 2009 on the Mac.

Any ideas?

ginodauri
09-28-2010, 07:23 AM
This probably because maya/python don't see directory.
Make userSetup.py file and add this lines:

import sys
sys.path.append( 'numPyDir')

misterwolfy
09-28-2010, 09:56 AM
great, where do I place the userSetup.py?

Thanks!

misterwolfy
09-29-2010, 04:36 AM
Running that in Maya seems to work! I do not get the error "numpy does not exist". I do get another error though.


import numpy
# Error: dlopen(/Library/Python/2.6/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_FillInfo
# Referenced from: /Library/Python/2.6/site-packages/numpy/core/multiarray.so
# Expected in: flat namespace
# in /Library/Python/2.6/site-packages/numpy/core/multiarray.so
# Traceback (most recent call last):
# File "<maya console>", line 2, in <module>
# File "/Library/Python/2.6/site-packages/numpy/__init__.py", line 136, in <module>
# import add_newdocs
# File "/Library/Python/2.6/site-packages/numpy/add_newdocs.py", line 9, in <module>
# from numpy.lib import add_newdoc
# File "/Library/Python/2.6/site-packages/numpy/lib/__init__.py", line 4, in <module>
# from type_check import *
# File "/Library/Python/2.6/site-packages/numpy/lib/type_check.py", line 8, in <module>
# import numpy.core.numeric as _nx
# File "/Library/Python/2.6/site-packages/numpy/core/__init__.py", line 5, in <module>
# import multiarray
# ImportError: dlopen(/Library/Python/2.6/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_FillInfo
# Referenced from: /Library/Python/2.6/site-packages/numpy/core/multiarray.so
# Expected in: flat namespace
# in /Library/Python/2.6/site-packages/numpy/core/multiarray.so #

CGTalk Moderation
09-29-2010, 04:36 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.