[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ImportError: No module named multiarray



On 11/16/2011 10:03 AM, Mathieu Malaterre wrote:
[CC me please]

Hi all,

   I am trying to package a tiny python module:

http://mentors.debian.net/debian/pool/main/t/tifffile/tifffile_20111112-1.dsc

   I thought I did it right, but I cannot load the python module
properly when installed, it fails with:

Hi Mathieu,
the problem is that numpy import fails. Numpy has both pure-python and compiled (e.g. multiarray.so) parts. When running a script, Python adds the directory containing the script to sys.path. Numpy is supposed to be imported from /usr/lib/pymodules/python2.7/numpy. /usr/lib/pymodules/python2.7/numpy contains links to /usr/share/pyshared/. Not all of numpy is is /usr/share/pyshared, but only the architecture-independent parts. The end result is that it is not possible to run a python script from /usr/share/pyshared.

Best,
Zbyszek

$ python /usr/share/pyshared/tifffile.py
Traceback (most recent call last):
   File "/usr/share/pyshared/tifffile.py", line 117, in<module>
     import numpy
   File "/usr/share/pyshared/numpy/__init__.py", line 132, in<module>
     import add_newdocs
   File "/usr/share/pyshared/numpy/add_newdocs.py", line 9, in<module>
     from lib import add_newdoc
   File "/usr/share/pyshared/numpy/lib/__init__.py", line 4, in<module>
     from type_check import *
   File "/usr/share/pyshared/numpy/lib/type_check.py", line 8, in<module>
     import numpy.core.numeric as _nx
   File "/usr/share/pyshared/numpy/core/__init__.py", line 5, in<module>
     import multiarray
ImportError: No module named multiarray
   However doing the following works nicely:

$ cd /tmp
$ cp /usr/share/pyshared/tifffile.py .
$ python tifffile.py --version
tifffile.py 2011.11.12

Thanks for suggestion,


Reply to: