Do you know why _NDFrameIndexer import execution problem in python?

Viewed 4149

When i

import geopandas as gpd or import geoplot as gplt or import geoplot.crs as gcrs

I don't know why cannot import name '_NDFrameIndexer' from 'pandas.core.indexing'

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-20-44a8cafd72fd> in <module>
      1 # for Geography
----> 2 import geopandas as gpd
      3 from geopy.distance import distance, lonlat
      4 from shapely.geometry import Polygon, LineString, Point
      5 from shapely.ops import nearest_points

~\Anaconda3\lib\site-packages\geopandas\__init__.py in <module>
----> 1 from geopandas.geoseries import GeoSeries
      2 from geopandas.geodataframe import GeoDataFrame
      3 
      4 from geopandas.io.file import read_file
      5 from geopandas.io.sql import read_postgis

~\Anaconda3\lib\site-packages\geopandas\geoseries.py in <module>
     10 
     11 from geopandas.plotting import plot_series
---> 12 from geopandas.base import GeoPandasBase, _series_unary_op, _CoordinateIndexer
     13 
     14 

~\Anaconda3\lib\site-packages\geopandas\base.py in <module>
      4 import pandas as pd
      5 from pandas import Series, DataFrame, MultiIndex
----> 6 from pandas.core.indexing import _NDFrameIndexer
      7 from shapely.geometry import box, MultiPoint, MultiLineString, MultiPolygon
      8 from shapely.ops import cascaded_union, unary_union

ImportError: cannot import name '_NDFrameIndexer' from 'pandas.core.indexing'             
(C:\Users\OWNER\Anaconda3\lib\site-packages\pandas\core\indexing.py)
1 Answers

Might have been the sledgehammer approach but I updated all packages conda update --all then searched for the latest geopandas conda search -f geopandas then installed the latest version conda install geopandas=0.8.1. After re-starting the kernal that was giving me trouble the issue was resolved.

Related