Problem with matplotlib Basemap in Spyder

557 views
Skip to first unread message

Leopoldo Pena

unread,
Jun 3, 2013, 9:47:14 PM6/3/13
to spyd...@googlegroups.com
Hi folks,

I am trying to get familiar with the Basemap library. Just trying some of the examples in the website I run into some problems under Spyder. If I run the same script on an separate Ipython shell or Notebook I have no problems at all. Running this script under Spyder 2.2-rc:

from mpl_toolkits.basemap import Basemap

import matplotlib.pyplot as plt

# setup Lambert Conformal basemap.

# set resolution=None to skip processing of boundary datasets.

m = Basemap(width=12000000,height=9000000,projection='lcc',

resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)

m.bluemarble()

plt.show()


I get the following error message:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 529, in runfile
    execfile(filename, namespace)
  File "/home/leo/python_scripts/Figures_templates/basemap.py", line 14, in <module>
    m.bluemarble()
  File "/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.py", line 3919, in bluemarble
    return self.warpimage(image='bluemarble',scale=scale,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.py", line 4027, in warpimage
    self._bm_rgba = pil_to_array(pilImage)[::-1,:]
  File "/usr/lib/pymodules/python2.7/matplotlib/image.py", line 1302, in pil_to_array
    x = toarray(im)
  File "/usr/lib/pymodules/python2.7/matplotlib/image.py", line 1287, in toarray
    x_str = im.tostring('raw', im.mode)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 560, in tostring
    return self.tobytes(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 534, in tobytes
    self.load()
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 192, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
AttributeError: 'module' object has no attribute '_getdecoder'
>>> runfile(r'/home/leo/python_scripts/Figures_templates/basemap.py', wdir=r'/home/leo/python_scripts/Figures_templates')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 529, in runfile
    execfile(filename, namespace)
  File "/home/leo/python_scripts/Figures_templates/basemap.py", line 14, in <module>
    m.bluemarble()
  File "/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.py", line 3919, in bluemarble
    return self.warpimage(image='bluemarble',scale=scale,**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/__init__.py", line 4027, in warpimage
    self._bm_rgba = pil_to_array(pilImage)[::-1,:]
  File "/usr/lib/pymodules/python2.7/matplotlib/image.py", line 1302, in pil_to_array
    x = toarray(im)
  File "/usr/lib/pymodules/python2.7/matplotlib/image.py", line 1287, in toarray
    x_str = im.tostring('raw', im.mode)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 560, in tostring
    return self.tobytes(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 534, in tobytes
    self.load()
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 192, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
AttributeError: 'module' object has no attribute '_getdecoder'


Any hint of what is going on here?

Thanks

Carlos Córdoba

unread,
Jun 9, 2013, 10:03:41 PM6/9/13
to spyd...@googlegroups.com
Hi Leopoldo,

You are right, this is a bug in our side. I filled an issue for it and it'll be fixed in 2.2.1.

Thanks for your interest in Spyder,
Carlos

El 03/06/13 20:47, Leopoldo Pena escribió:
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages