<div dir="ltr"><div><div>Mike, this is where I noticed this before: <a href="https://github.com/matplotlib/basemap/issues/242">https://github.com/matplotlib/basemap/issues/242</a><br><br></div>Simple example:<br><br></div><div>import matplotlib.pyplot as plt<br></div><div>from mpl_toolkits.basemap import Basemap<br>m=Basemap(projection='cyl',llcrnrlon=-90,llcrnrlat=30,urcrnrlon=-60,urcrnrlat=60)<br>m.arcgisimage(verbose=True)<br>plt.show()<br><pre><code><br></code></pre><pre><code>Ben Root</code></pre><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 11:32 AM, Michael Droettboom <span dir="ltr"><<a href="mailto:mdroettboom@continuum.io" target="_blank">mdroettboom@continuum.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Can you provide a standalone example to reproduce, or fire up the debugger and let me know that the value of "basemap_url" is on line 4270 of basemap/__init__.py?  Were that to point to somewhere that fails, one would expect this error.  (Though in the case of 1.5.1 something additionally funky is going on, I'm not necessarily surprised by the result with 1.4.3 without additional information).<div><br></div><div>Mike</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 10:53 AM, Benjamin Root <span dir="ltr"><<a href="mailto:ben.v.root@gmail.com" target="_blank">ben.v.root@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Yes, I recently noticed this, too. CC-ing Mike Droettboom, I think this is caused by our recent changes to _image.cpp to add error-checking.<br><br></div>Ben Root<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Jan 22, 2016 at 3:43 AM, Mike Tercek via Matplotlib-devel <span dir="ltr"><<a href="mailto:matplotlib-devel@python.org" target="_blank">matplotlib-devel@python.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div>When I make a map with the basemap and try to insert a background image from acrgis servers, the following code works ok if I have maplotlib version 1.3.1 installed:</div><div><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">m = Basemap(llcrnrlon=ll_lon,llcrnrlat=ll_lat,urcrnrlon=ur_lon,urcrnrlat=ur_lat,epsg=3857,lat_0=latz,lon_0=lonz, fix_aspect = False)</div><div>

</div><div dir="ltr">m.arcgisimage(service='ESRI_Imagery_World_2D', xpixels = 2000, verbose= False, dpi = 80)</div><div dir="ltr"><br></div><div dir="ltr">However, if I have matplotlib version 1.4.3 installed I get the following error:</div><div dir="ltr"><br></div><div dir="ltr">Python 3.4.3 (default, Oct 14 2015, 20:28:29) </div><div dir="ltr">[GCC 4.8.4] on linux</div><div dir="ltr">Type "help", "copyright", "credits" or "license" for more information.</div><div dir="ltr">>>> runfile('/media/mt/7670100C700FD1B3/vegviz/contain/xv.py', wdir=r'/media/mt/7670100C700FD1B3/vegviz/contain')</div><div dir="ltr">Content-Type: text/html</div><div dir="ltr"><br></div><div dir="ltr">Traceback (most recent call last):</div><div dir="ltr">  File "<stdin>", line 1, in <module></div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 680, in runfile</div><div dir="ltr">    execfile(filename, namespace)</div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 85, in execfile</div><div dir="ltr">    exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)</div><div dir="ltr">  File "/media/mt/7670100C700FD1B3/vegviz/contain/xv.py", line 401, in <module></div><div dir="ltr">    m,fig = make_base_map(title,frame_bound,park_bound,inset,inset_location,inset_alignment,ll_lon,ll_lat,ur_lon,ur_lat,latz,lonz,True)</div><div dir="ltr">  File "/media/mt/7670100C700FD1B3/vegviz/contain/xv.py", line 110, in make_base_map</div><div dir="ltr">    m.arcgisimage(service='ESRI_Imagery_World_2D', xpixels = 2000, verbose= False, dpi = 80)</div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/mpl_toolkits/basemap/__init__.py", line 4270, in arcgisimage</div><div dir="ltr">    return self.imshow(imread(urllib.request.urlopen(basemap_url)),origin='upper')</div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/matplotlib/image.py", line 1270, in imread</div><div dir="ltr">    return handler(fname)</div><div dir="ltr">RuntimeError: _image_module::readpng: file not recognized as a PNG file</div><div dir="ltr"><br></div><div dir="ltr">And if I install matplotlib 1.5.1, I get this error:</div><div dir="ltr"><br></div><div dir="ltr">Python 3.4.3 (default, Oct 14 2015, 20:28:29) </div><div dir="ltr">[GCC 4.8.4] on linux</div><div dir="ltr">Type "help", "copyright", "credits" or "license" for more information.</div><div dir="ltr">>>> runfile('/media/mt/7670100C700FD1B3/vegviz/contain/xv.py', wdir=r'/media/mt/7670100C700FD1B3/vegviz/contain')</div><div dir="ltr">Content-Type: text/html</div><div dir="ltr"><br></div><div dir="ltr">Traceback (most recent call last):</div><div dir="ltr">  File "<stdin>", line 1, in <module></div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 680, in runfile</div><div dir="ltr">    execfile(filename, namespace)</div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 85, in execfile</div><div dir="ltr">    exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)</div><div dir="ltr">  File "/media/mt/7670100C700FD1B3/vegviz/contain/xv.py", line 401, in <module></div><div dir="ltr">    m,fig = make_base_map(title,frame_bound,park_bound,inset,inset_location,inset_alignment,ll_lon,ll_lat,ur_lon,ur_lat,latz,lonz,True)</div><div dir="ltr">  File "/media/mt/7670100C700FD1B3/vegviz/contain/xv.py", line 110, in make_base_map</div><div dir="ltr">    m.arcgisimage(service='ESRI_Imagery_World_2D', xpixels = 2000, verbose= False, dpi = 80)</div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/mpl_toolkits/basemap/__init__.py", line 4270, in arcgisimage</div><div dir="ltr">    return self.imshow(imread(urllib.request.urlopen(basemap_url)),origin='upper')</div><div dir="ltr">  File "/usr/local/lib/python3.4/dist-packages/matplotlib/image.py", line 1326, in imread</div><div dir="ltr">    return handler(fname)</div><div dir="ltr">SystemError: error return without exception set</div><div dir="ltr"><br></div><div dir="ltr"><br></div></div></div><br></div></div>_______________________________________________<br>
Matplotlib-devel mailing list<br>
<a href="mailto:Matplotlib-devel@python.org" target="_blank">Matplotlib-devel@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/matplotlib-devel" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/matplotlib-devel</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr">Michael Droettboom<div>Continuum Analytics</div></div></div>
</font></span></div>
</blockquote></div><br></div>