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

The*_*cle 16 python error-handling geopandas

I'am trying to run a simple geopandas code using ANACONDA spyder. However, I'am encountering an error.

I have included the code and the error as below:

--

here is the code:

import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world.plot()
import matplotlib.pyplot as plt
plt.show()
Run Code Online (Sandbox Code Playgroud)

--

here is the error:

File "C:\Users\usr\Anaconda3\lib\site-packages\geopandas\plotting.py", line 90, in plot_polygon_collection "The descartes package is required for plotting polygons in geopandas."

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

--

I checked online and I couldn't find troubleshooting solution for this problem. Can anyone please help and advise?

appreciated.

Bra*_*pel 20

Depending on your package manager install descartes. In anaconda prompt do the following:

conda install descartes
Run Code Online (Sandbox Code Playgroud)

将 conda 替换为 pip 或您使用的其他包管理器。