Bigboss01
Bigboss01

Reputation: 618

Geoplot: ImportError: cannot import name '_PolygonPatch' from 'geopandas.plotting'

ImportError                               Traceback (most recent call last)
<ipython-input-20-3916336930a7> in <module>
----> 1 import geoplot

/opt/anaconda3/envs/TF/lib/python3.7/site-packages/geoplot/__init__.py in <module>
----> 1 from .geoplot import (
      2     pointplot, polyplot, choropleth, cartogram, kdeplot, sankey, voronoi, quadtree, webmap,
      3     __version__
      4 )
      5 from .crs import (

/opt/anaconda3/envs/TF/lib/python3.7/site-packages/geoplot/geoplot.py in <module>
     14 import shapely.geometry
     15 import pandas as pd
---> 16 from geopandas.plotting import _PolygonPatch as GeopandasPolygonPatch
     17 import contextily as ctx
     18 import mapclassify as mc

ImportError: cannot import name '_PolygonPatch' from 'geopandas.plotting' (/opt/anaconda3/envs/TF/lib/python3.7/site-packages/geopandas/plotting.py)

Hello, I would like to use geoplot, I get this error when I try to run it. I installed it with conda forge and pip but neither work. Here are some of the packages I have:

cartopy                   0.18.0           py37hf1ba7ce_1  
descartes                 1.1.0                    pypi_0    pypi
fiona                     1.8.13.post1     py37h9c05f0f_0  
geographiclib             1.52                     pypi_0    pypi
geopandas                 0.9.0                      py_1  
geopandas-base            0.9.0                      py_1  
geoplot                   0.4.3                    pypi_0    pypi
geopy                     2.2.0                    pypi_0    pypi
geos                      3.8.0                hb1e8313_0  

Please let me know if there's a specific package I need or if you know what's going on!

This is the result of help(geopandas.plotting):

plot_dataframe(df, column=None, cmap=None, color=None, ax=None, cax=None, categorical=False, legend=False, scheme=None, k=5, vmin=None, vmax=None, markersize=None, figsize=None, legend_kwds=None, categories=None, classification_kwds=None, missing_kwds=None, aspect='auto', **style_kwds)

plot_linestring_collection = old(*args, **kwargs)
    
plot_point_collection = old(*args, **kwargs)
    
plot_polygon_collection = old(*args, **kwargs)
    
plot_series(s, cmap=None, color=None, ax=None, figsize=None, aspect='auto', **style_kwds)

I am running python 3.7.7

Upvotes: 2

Views: 1674

Answers (0)

Related Questions