Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geopandas ImportError: The descartes package is required for plotting polygons in 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()

--

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.

like image 549
The Oracle Avatar asked Oct 16 '19 15:10

The Oracle


1 Answers

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

conda install descartes

Replace conda with pip or an other package manager of your use.

like image 71
BramAppel Avatar answered Sep 21 '22 00:09

BramAppel