You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cartopy installation documentation lists required and optional libraries. But when I install only the required libraries and run the "Features" Gallery example, I get a ShapefileException.
Installing the "optional" fiona library fixes the problem.
I think the problem should be resolved when using only the required libraries, or fiona should be added to the "required" list
Traceback (most recent call last):
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 1233, in _on_timer
ret = func(*args, **kwargs)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/backends/backend_macosx.py", line 71, in callback_func
callback()
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/backends/backend_macosx.py", line 94, in _draw_idle
self.draw()
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/backends/backend_macosx.py", line 53, in draw
super().draw()
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/backends/backend_agg.py", line 388, in draw
self.figure.draw(self.renderer)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/artist.py", line 95, in draw_wrapper
result = draw(artist, renderer, *args, **kwargs)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/figure.py", line 3154, in draw
mimage._draw_list_compositing_images(
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/cartopy/mpl/geoaxes.py", line 535, in draw
return super().draw(renderer=renderer, **kwargs)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 3070, in draw
mimage._draw_list_compositing_images(
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images
a.draw(renderer)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/matplotlib/artist.py", line 72, in draw_wrapper
return draw(artist, renderer)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/cartopy/mpl/feature_artist.py", line 152, in draw
geoms = self._feature.intersecting_geometries(extent)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/cartopy/feature/__init__.py", line 305, in intersecting_geometries
return super().intersecting_geometries(extent)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/cartopy/feature/__init__.py", line 108, in intersecting_geometries
return (geom for geom in self.geometries() if
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/cartopy/feature/__init__.py", line 290, in geometries
geometries = tuple(shapereader.Reader(path).geometries())
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/cartopy/io/shapereader.py", line 136, in __init__
self._reader = reader = shapefile.Reader(filename)
File "/Users/crawford/opt/anaconda3/envs/seaplan/lib/python3.9/site-packages/shapefile.py", line 825, in __init__
raise ShapefileException("Shapefile Reader requires a shapefile or file-like object.")
shapefile.ShapefileException: Shapefile Reader requires a shapefile or file-like object.
Hi @WayneCrawford, I think you are seeing this error because you are have an older version of pyshp. Could you upgrade that to v2.3 and try again? I think fiona gets used in place of pyshp if installed, but should not be necessary.
Note we have increased the minimum required pyshp for the next release (which should be fairly soon) #2290.
Description
The cartopy installation documentation lists required and optional libraries. But when I install only the required libraries and run the "Features" Gallery example, I get a ShapefileException.
Installing the "optional" fiona library fixes the problem.
I think the problem should be resolved when using only the required libraries, or fiona should be added to the "required" list
Code to reproduce
Traceback
Full environment definition
Operating system
macos 14.2.1
Cartopy version
0.22
conda list
pip list
The text was updated successfully, but these errors were encountered: