[wxPython-users] plot.py and numpy compatibility/confusion on Solaris

Christopher Barker Chris.Barker at noaa.gov
Tue Sep 19 13:54:34 PDT 2006


chris botos wrote:
> Somehow I'm using mismatched libraries, but I'm not sure how it happened.

wx.plot was written from the older "Numeric" module, rather than the 
latest numpy module, which is what you have installed.

Your choices are:

1) Install Numeric instead, you can get it from eh sourceforge download 
site, and other places. Note that the import statement may have to be 
changed to :

import Numeric as numpy

however, as it is calling it numpy ,I suspect someone may have updated 
it to a pre-release numpy, which had some of the older Numeric names in 
place, which brings us to option:

2) replace the "import numpy" with "import numpy.oldnumeric as numpy". 
That will give you the Numeric-compatible names.

or, the best long-term option:

3) Port it to work with the new numpy. As of the version you have, the 
API shouldn't change for a good while. There are scripts and notes to 
help you do that on the scipy site, but you'll probably only have a few 
issues:

numpy.Float64  --> numpy.float64   (or just numpy.float, that will give 
you the same float as Python uses, usually 64bit)

Some of the integer types have different names too.

If you do this, be sure to contribute a patch to Robin.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list