[Numpy-discussion] (@Pat Marion) Re: Yes, this one again "ImportError: No module named multiarray"
Tue Mar 12 09:23:53 CDT 2013
Thanks for copying me, Aron.
Hi Dinesh, I have a github project which demonstrates how to use numpy with
freeze. The project's readme includes more information:
It does require a small patch to CPython's import.c file. I haven't tried
posted this patch to the CPython developers, perhaps there'd be interest
incorporating it upstream.
On Wed, Mar 13, 2013 at 12:08 AM, Aron Ahmadia <email@example.com> wrote:
> Pat Marion at Kitware did some work on this, I'm pinging him on the thread.
> On Tue, Mar 12, 2013 at 2:05 PM, Dinesh B Vadhia <
> firstname.lastname@example.org> wrote:
>> Does that mean numpy won't work with freeze/create_executable type of
>> tools or is there a workaround?
>> *From:* Aron Ahmadia <email@example.com>
>> *Sent:* Tuesday, March 12, 2013 6:17 AM
>> *To:* Discussion of Numerical Python <firstname.lastname@example.org>
>> *Subject:* Re: [Numpy-discussion] Yes,this one again "ImportError: No
>> module named multiarray"
>> multiarray is an extension module that lives within numpy/core, that is,
>> when, "import multiarray" is called, (and it's the first imported extension
>> module in numpy), multiarray.ext (ext being dll on Windows I guess), gets
>> dynamically loaded.
>> "No module named multiarray" is indicating problems with your freeze
>> setup. Most of these tools don't support locally imported extension
>> Does this help you get oriented on your problem?
>> On Tue, Mar 12, 2013 at 1:01 PM, Dinesh B Vadhia <
>> email@example.com> wrote:
>>> I've been using Numpy/Scipy for >5 years so know a little on how to get
>>> around them. Recently, I've needed to either freeze or create executables
>>> with tools such as PyInstaller, Cython, Py2exe and others on both Windows
>>> (XP 32-bit, 7 64-bit) and Ubuntu (12.04) Linux (64-bit). The test
>>> program (which runs perfectly with the Python interpreter) is very simple:
>>> import numpy
>>> def main():
>>> print numpy.array([12, 23, 34, 45, 56, 67, 78, 89, 90])
>>> if __name__ == '__main__':
>>> The software versions are Python 2.7.3, Numpy 1.7.0, and Scipy 0.11.
>>> The "import numpy" causes an "ImportError: No module named multiarray". After
>>> endless Googling, I am none the wiser about what (really) causes the
>>> ImportError let alone what the solution is. The Traceback, similar to
>>> others found on the web, is:
>>> Traceback (most recent call last):
>>> File "test.py", ...
>>> File "C:\Python27\lib\site-packages\numpy\__init__.py", line 154, in
>>> import add_newdocs
>>> File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 9, in
>>> from numpy.lib import add_newdoc
>>> File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 4, in
>>> from type_check import *
>>> File "C:\Python27\lib\site-packages\numpy\lib\type_check.py", line 8,
>>> in <module>
>>> import numpy.core.numeric as _nx
>>> File "C:\Python27\lib\site-packages\numpy\core\__init__.py", line 5,
>>> in <module>
>>> import multiarray
>>> ImportError: No module named multiarray.
>>> Could someone shed some light on this - please? Thx.
>>> NumPy-Discussion mailing list
>> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion