1
resposta

problema em plotar o mapa

não estou conseguindo plotar o mapa do RJ a partir do comando rj.plot()

aparece esta mensagem: " ModuleNotFoundError Traceback (most recent call last) ~\Anaconda3\lib\site-packages\geopandas\plotting.py in plot_polygon_collection(ax, geoms, values, color, cmap, vmin, vmax, **kwargs) 86 try: ---> 87 from descartes.patch import PolygonPatch 88 except ImportError:

ModuleNotFoundError: No module named 'descartes'

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last) in ----> 1 rj.plot()

~\Anaconda3\lib\site-packages\geopandas\geodataframe.py in plot(self, args, *kwargs) 604 from there. 605 """ --> 606 return plot_dataframe(self, args, *kwargs) 607 608 plot.doc = plot_dataframe.doc

~\Anaconda3\lib\site-packages\geopandas\plotting.py in plot_dataframe(df, column, cmap, color, ax, cax, categorical, legend, scheme, k, vmin, vmax, markersize, figsize, legend_kwds, classification_kwds, *style_kwds) 500 figsize=figsize, 501 markersize=markersize, --> 502 *style_kwds 503 ) 504

~\Anaconda3\lib\site-packages\geopandas\plotting.py in plot_series(s, cmap, color, ax, figsize, *style_kwds) 339 values_ = values[poly_idx] if cmap else None 340 plot_polygon_collection( --> 341 ax, polys, values_, facecolor=facecolor, cmap=cmap, *style_kwds 342 ) 343

~\Anaconda3\lib\site-packages\geopandas\plotting.py in plot_polygon_collection(ax, geoms, values, color, cmap, vmin, vmax, **kwargs) 88 except ImportError: 89 raise ImportError( ---> 90 "The descartes package is required for plotting polygons in geopandas." 91 ) 92 from matplotlib.collections import PatchCollection

ImportError: The descartes package is required for plotting polygons in geopandas."

onde consigo encontrar esse pacote descartes?

muito obrigada

1 resposta

Oi Anna. Para resolver esse problema basta abrir um terminal e digitar:

conda install descartes

Daí é só confirmar com yes os passos de instalação.

Depois disso o código python deve funcionar normalmente.