Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you know why _NDFrameIndexer import execution problem in python?

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)
like image 906
Jang장진웅 Avatar asked Sep 10 '26 11:09

Jang장진웅


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.

like image 101
mbauer Avatar answered Sep 13 '26 01:09

mbauer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!