熊猫导入:ModuleNotFoundError:没有名为“ pandas.api.extensions”的模块

时间:2019-10-25 08:56:41

标签: import geopandas

我想将geopandas导入为gpd,但出现错误消息

  

ModuleNotFoundError:没有名为“ pandas.api.extensions”的模块。

要导入大熊猫,我该怎么做?

我通过anaconda promt安装了geopandas:

C:\Users\sar>conda install -c conda-forge geopandas

  

收集包元数据(current_repodata.json):完成

     

解决环境:已完成

     

已安装所有请求的软件包。

当我导入geopandas时,控制台中将显示以下代码:

import geopandas as gpd

 Traceback (most recent call last):

  File "<ipython-input-16-a62d01c1d62e>", line 1, in <module>
    import geopandas as gpd

  File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\__init__.py", line 1, in <module>
    from geopandas.geoseries import GeoSeries  # noqa

  File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\geoseries.py", line 15, in <module>
    from geopandas.base import GeoPandasBase, _delegate_property

  File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\base.py", line 13, in <module>
    from .array import GeometryArray, GeometryDtype

  File "C:\Users\sar\Anaconda\envs\codingingis\lib\site-packages\geopandas\array.py", line 7, in <module>
    from pandas.api.extensions import ExtensionArray, ExtensionDtype

ModuleNotFoundError: No module named 'pandas.api.extensions'

在array.py中找不到此代码:

from pandas.api.extensions import ExtensionArray, ExtensionDtype

0 个答案:

没有答案