[Numpy-discussion] Re: [Matplotlib-users] numarray - was trying to freeze wxmpl matplotlib and wxpython

Todd Miller jmiller at stsci.edu
Thu Oct 20 09:35:36 CDT 2005


Tim Burgess wrote:

> Hi all,
>
> First thanks to all those who have been helping out - it is really 
> appreciated.
>
> Since I couldnt build numarray - I looked at the new import code in 
> the cvs init module and ripped it off and stuffed it into my numarray 
> installation and then when that didnt work  - I jammed it right up 
> front of my application.
>
> It looks like this
>
> def main():
>     import numarray.numarrayall
>     from numarray.numinclude import version as __version__
>
>     # stolen from next numarray version in cvs TjB
>
>     import numarray._conv
>     import numarray._sort
>     import numarray._bytes
>     import numarray._ufunc
>     import numarray._ufuncBool
>     import numarray._ufuncInt8
>     import numarray._ufuncUInt8
>     import numarray._ufuncInt16
>     import numarray._ufuncUInt16
>     import numarray._ufuncInt32
>     import numarray._ufuncUInt32
>     import numarray._ufuncFloat32
>     import numarray._ufuncFloat64
>     import numarray._ufuncComplex32
>     import numarray._ufuncComplex64
>     import numarray._ndarray
>     import numarray._numarray
>     import numarray._chararray
>     import numarray._objectarray
>     import numarray.memory
>     import numarray._converter
>     import numarray._operator
>     import numarray._numerictype
>     import numarray.libnumarray
>     import numarray.libnumeric
>     import numarray._ufuncInt64
>     import numarray._ufuncUInt64
>
>     print numarray.__version__
>
>     application = BoaApp(0)
>
> Still no go - but a changed error message.... grrr

Well,  that's progress anyway.

>
> I get
>
> Traceback (most recent call last):
>   File "AEMdaApp.py", line 81, in ?
>   File "AEMdaApp.py", line 41, in main
>   File "numarray\__init__.pyc", line 42, in ?
>   File "numarray\numarrayall.pyc", line 1, in ?
>   File "numarray\numerictypes.pyc", line 35, in ?
>   File "numarray\numinclude.pyc", line 4, in ?
>   File "numarray\_ndarray.pyc", line 9, in ?
>   File "numarray\_ndarray.pyc", line 7, in __load
> ImportError: init_ndarray: can't find memory.new_memory

Is numarray.memory actually present in your install directory?  Can you 
CD to that directory and import memory by itself?

> then - probably because I was reading the numarray manual this morning 
> - I went to my numarray install and decided to run testall.py
>
> I got

There's two things going on here.  (1) This manner of running the 
numarray self-tests isn't recommended since it doesn't work anywhere.  
Read Doc/INSTALL.txt for how to run them.  (2)  There's bit-rot in 
numarray CVS for windows.

I'm working on the rot now.

> F:\Python24\Lib\site-packages\numarray>\python24\python testall.py
> Testing numarray 1.3.3 on normal Python (2, 4, 1, 'final', 0) on 
> platform win32
> **********************************************************************
> File "F:\python24\lib\site-packages\numarray\numtest.py", line 2843, 
> in cache p
> ss
> Failed example:
>     cPickle.loads(cPickle.dumps(arange(5)+1j))
> Exception raised:
>     Traceback (most recent call last):
>       File "F:\Python24\lib\doctest.py", line 1243, in __run
>         compileflags, 1) in test.globs
>       File "<doctest cache pass[968]>", line 1, in ?
>     PicklingError: Can't pickle <built-in function 
> memory_from_string>: it's no
>  the same object as memory.memory_from_string
> **********************************************************************
> File "F:\python24\lib\site-packages\numarray\numtest.py", line 2849, 
> in cache p
> ss
> Failed example:
>     p = p.dump(a)
> Exception raised:
>     Traceback (most recent call last):
>       File "F:\Python24\lib\doctest.py", line 1243, in __run
>         compileflags, 1) in test.globs
>       File "<doctest cache pass[973]>", line 1, in ?
>     PicklingError: Can't pickle <built-in function 
> memory_from_string>: it's no
>  the same object as memory.memory_from_string
> **********************************************************************
> File "F:\python24\lib\site-packages\numarray\numtest.py", line 2850, 
> in cache p
> ss
> Failed example:
>     p = p.dump(b)
> Exception raised:
>
> and so on for quite some time.
>
> Hmm the message about
>     memory.memory_from_string
> and my applications
>     ImportError: init_ndarray: can't find memory.new_memory
>
> are these a little related? Am I clutching at straws?
>
> Yet my app runs fine under any ide I wish to use.
>
> WAIT!  - my install of numarray is broken....
> I deleted it and reinstalled - still broken

I'm a little confused here.  How is numarray installed where your 
application actually works?  How is numarray installed where numarray 
does not work?  (I was under the impression that you're using a tool to 
build a self-contained installer... which isn't working.  I figured your 
development systems have numarray installed independently... which is 
working.  What are you doing?)

> I installed on my laptop and tested - broken there too
>
> My legacy python 2.3 and numarray 1.3.3 installation passes all the 
> tests just fine.
>
> Is there a problem with python2.4.1 and numarray 1.3.3?

Nope.

> Could some kind soul build me a numarray windows installer for python 
> 2.4 from cvs - please - so that I can see if that works better with 
> py2exe.

Let me know if you still want this and I'll make one for you.

FYI,  MinGW works great for matplotlib but you may have to 
row-your-own-boat when it comes to numarray.  As far as I know,  there 
are missing glibc dependencies for numarray,  particularly IEEE 
exception handling.

Regards,
Todd






More information about the Numpy-discussion mailing list