在 google colab 上导入 osmnx 给我一个错误

import osmnx on google colab give me an error

我正在尝试在 google Colab 上导入 osmnx,它确实使用 !pip install osmnx 安装成功,但是当我尝试像这样在 Colab 中导入它时 import osmnx给我这个错误

AttributeError: /usr/bin/python3: undefined symbol: Error_GetLastErrorNum

有谁知道如何解决这个错误?

您需要先安装libspatialindex-dev。

!apt install libspatialindex-dev
!pip install osmnx

然后就可以导入了

import osmnx