小编Fer*_*ndo的帖子

为什么在尝试读取 geopanda 包含的数据集中的文件时会出现错误?

我刚刚在我的新笔记本电脑中安装了 Anaconda,并创建了一个安装了 geopandas 的环境。我尝试通过以下代码上传geopandas附带的世界地图:

import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
Run Code Online (Sandbox Code Playgroud)

但我收到以下错误消息:

File ~/anaconda3/envs/mapas_test/lib/python3.8/site-packages/shapely/geometry/base.py:854, in BaseMultipartGeometry.__array_interface__(self)
    851 @property
    852 def __array_interface__(self):
    853     """Provide the Numpy array protocol."""
--> 854     raise NotImplementedError("Multi-part geometries do not themselves "
    855                               "provide the array interface")

NotImplementedError: Multi-part geometries do not themselves provide the array interface
Run Code Online (Sandbox Code Playgroud)

由于我的旧笔记本电脑上从未出现过此错误,我猜这与安装过程中的某些问题有关,但我可能是错的。以下是有关安装的技术细节。

操作系统:Ubuntu 22.04.1

Python版本:3.9.12

康达版本4.13.0

geopandas 版本 0.9.0

匀称版本1.7.1

不确定它是否相关,但环境中安装的唯一其他软件包是 jupyter 版本 1.0.0

python shapely conda geopandas

6
推荐指数
1
解决办法
3657
查看次数

标签 统计

conda ×1

geopandas ×1

python ×1

shapely ×1