我刚刚在我的新笔记本上安装了Anaconda,并创建了一个环境,其中安装了地质公园。我试图通过以下代码上传地质公园附带的世界地图:
import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
但是,我得到以下错误消息:
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
由于这个错误从来没有出现在我的旧笔记本电脑,我想它是有关安装过程中的一些问题,但我可能是错误的。以下是安装的技术细节。
操作系统: Ubuntu 22.04.1
Python版本: 3.9.12
Conda版本4.13.0
地质公园0.9.0版
外形版本1.7.1
也不确定是否相关,但环境中安装的唯一其他软件包是jupyter版本1.0.0
发布于 2022-08-14 20:22:45
这是由于shapely 1.7和numpy 1.23不兼容造成的。要么更新到1.8,要么将numpy降级,否则就无法工作。
https://stackoverflow.com/questions/73347010
复制相似问题