Basemap/matplotlib

Hi all,

I'm new to this product so my question involves installation issues with Basemap. I had no problem installing matplotlib and as far as I could tell, there were no issues preventing the Basemap installation. However, when I run the test scripts I get an error message that seems to be related to cPickle. Several of the example scripts yield the same error, but not all. Any suggestions?

The message is included below and the platform I'm using is Fedora core 2 linux. Python version 2.3.3.

Thanks for any suggestions,
Derrick

log of the error messages...

/usr/lib/python2.3/site-packages/matplotlib/__init__.py:636: UserWarning: Bad key "verbose.erro" on line 199 in /home/snowden/.matplotlibrc
   warnings.warn('Bad key "%s" on line %d in %s' % (key, cnt, fname))
loaded rc file /home/snowden/.matplotlibrc
matplotlib version 0.80
verbose.level helpful
interactive is False
platform is linux2
numerix Numeric 23.3
font search path ['/usr/share/matplotlib']
loaded ttfcache file /home/snowden/.ttffont.cache
matplotlib data path /usr/share/matplotlib
backend GTKAgg version 2.2.0
Traceback (most recent call last):
   File "plotmap.py", line 11, in ?
     topodict = cPickle.load(open('etopo20.pickle','rb'))
   File "/usr/lib/python2.3/site-packages/numarray/generic.py", line 160, in ClassicUnpickler
     self.__setstate__(state)
   File "/usr/lib/python2.3/site-packages/numarray/numarraycore.py", line 492, in __setstate__
     self._type = state["_type"]
AttributeError: ("'str' object has no attribute 'name'", <function ClassicUnpickler at 0x40e435a4>, (<class 'numarray.numarraycore.NumArray'>, {'_type': 'Float32', '_itemsize': 4, '_shape': (1081,), '_bytestride': 4, '_byteoffset': 0, '_version': '1.1', '_byteorder': 'big', '_data': <memory at 083f7568 with size:4324 held by object 083f7548 aliasing object 00000000>, '_strides': (4,)}))

Derrick Snowden wrote:

Hi all,

I'm new to this product so my question involves installation issues with Basemap. I had no problem installing matplotlib and as far as I could tell, there were no issues preventing the Basemap installation. However, when I run the test scripts I get an error message that seems to be related to cPickle. Several of the example scripts yield the same error, but not all. Any suggestions?

The message is included below and the platform I'm using is Fedora core 2 linux. Python version 2.3.3.

Thanks for any suggestions,
Derrick

log of the error messages...

/usr/lib/python2.3/site-packages/matplotlib/__init__.py:636: UserWarning: Bad key "verbose.erro" on line 199 in /home/snowden/.matplotlibrc
  warnings.warn('Bad key "%s" on line %d in %s' % (key, cnt, fname))
loaded rc file /home/snowden/.matplotlibrc
matplotlib version 0.80
verbose.level helpful
interactive is False
platform is linux2
numerix Numeric 23.3
font search path ['/usr/share/matplotlib']
loaded ttfcache file /home/snowden/.ttffont.cache
matplotlib data path /usr/share/matplotlib
backend GTKAgg version 2.2.0
Traceback (most recent call last):
  File "plotmap.py", line 11, in ?
    topodict = cPickle.load(open('etopo20.pickle','rb'))
  File "/usr/lib/python2.3/site-packages/numarray/generic.py", line 160, in ClassicUnpickler
    self.__setstate__(state)
  File "/usr/lib/python2.3/site-packages/numarray/numarraycore.py", line 492, in __setstate__
    self._type = state["_type"]
AttributeError: ("'str' object has no attribute 'name'", <function ClassicUnpickler at 0x40e435a4>, (<class 'numarray.numarraycore.NumArray'>, {'_type': 'Float32', '_itemsize': 4, '_shape': (1081,), '_bytestride': 4, '_byteoffset': 0, '_version': '1.1', '_byteorder': 'big', '_data': <memory at 083f7568 with size:4324 held by object 083f7548 aliasing object 00000000>, '_strides': (4,)}))

Derrick: The example is trying to read a Pickle file with some data. I think the problem may be that your numarray is too old. New versions of numarray cannot read pickles created by very old versions of numarry, apparently. Is your numarray older than 1.0?

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

Jeff,

You're probably right, my numarray.__version__ = 0.9. After updating numarray
to 1.3.1 all the examples ran except randompoints.py. Perhaps you knew this.
After changing line 44 as below...

# r = (m.projtran.rmajor/1000.)*get_dist(lon,lons[0:nob],lat,lats[0:nob])
      r = (m.projtran.rsphere/1000.)*get_dist(lon,lons[0:nob],lat,lats[0:nob])

randompoints.py ran to completion. I'm not sure if it was an appropriate
change but at least the example competed. thanks Jeff...

Best,
Derrick

···

On Wed May 11 2005 01:40 pm, Jeff Whitaker wrote:

Derrick Snowden wrote:
> Hi all,
>
> I'm new to this product so my question involves installation issues
> with Basemap. I had no problem installing matplotlib and as far as I
> could tell, there were no issues preventing the Basemap installation.
> However, when I run the test scripts I get an error message that seems
> to be related to cPickle. Several of the example scripts yield the
> same error, but not all. Any suggestions?
>
> The message is included below and the platform I'm using is Fedora
> core 2 linux. Python version 2.3.3.
>
> Thanks for any suggestions,
> Derrick
>
>
> log of the error messages...
>
> /usr/lib/python2.3/site-packages/matplotlib/__init__.py:636:
> UserWarning: Bad key "verbose.erro" on line 199 in
> /home/snowden/.matplotlibrc
> warnings.warn('Bad key "%s" on line %d in %s' % (key, cnt, fname))
> loaded rc file /home/snowden/.matplotlibrc
> matplotlib version 0.80
> verbose.level helpful
> interactive is False
> platform is linux2
> numerix Numeric 23.3
> font search path ['/usr/share/matplotlib']
> loaded ttfcache file /home/snowden/.ttffont.cache
> matplotlib data path /usr/share/matplotlib
> backend GTKAgg version 2.2.0
> Traceback (most recent call last):
> File "plotmap.py", line 11, in ?
> topodict = cPickle.load(open('etopo20.pickle','rb'))
> File "/usr/lib/python2.3/site-packages/numarray/generic.py", line
> 160, in ClassicUnpickler
> self.__setstate__(state)
> File "/usr/lib/python2.3/site-packages/numarray/numarraycore.py",
> line 492, in __setstate__
> self._type = state["_type"]
> AttributeError: ("'str' object has no attribute 'name'", <function
> ClassicUnpickler at 0x40e435a4>, (<class
> 'numarray.numarraycore.NumArray'>, {'_type': 'Float32', '_itemsize':
> 4, '_shape': (1081,), '_bytestride': 4, '_byteoffset': 0, '_version':
> '1.1', '_byteorder': 'big', '_data': <memory at 083f7568 with
> size:4324 held by object 083f7548 aliasing object 00000000>,
> '_strides': (4,)}))

Derrick: The example is trying to read a Pickle file with some data. I
think the problem may be that your numarray is too old. New versions of
numarray cannot read pickles created by very old versions of numarry,
apparently. Is your numarray older than 1.0?

-Jeff

--
Derrick Snowden
PhOD/AOML/NOAA
4301 Rickenbacker Causeway
Miami, FL 33149
Office: 305.361.4322 Fax: 305.361.4392