我试图在python中裁剪空间数据,但是当我运行我的代码时...
europe = gpd.clip(worldmap, europe_bound_gdf)
..。我得到了错误:
(ImportError: Spatial indexes require either
rtreeor
pygeos`。)
当我尝试使用以下命令安装rtree时:
pip3 install rtree
有人告诉我:
Requirement already satisfied: rtree in /Users/joshuajones/.pyenv/versions/3.9.4/lib/python3.9/site-packages (0.9.7`)
那么为什么我的代码不能工作呢?
发布于 2021-05-24 22:25:50
我也有同样的问题,这为我解决了这个问题:
pip uninstall rtree
sudo apt install libspatialindex-dev
pip install rtree
找到答案here。
发布于 2021-11-07 18:12:16
在我的例子中,唯一有帮助的是:
安装并导入condalab,运行两次。
!pip install -q condacolab -q
import condacolab
condacolab.install()
安装geopandas,这可能需要很长时间
!conda install geopandas
import geopandas as gpd
发布于 2021-11-19 16:42:29
GStav's answer适用于我,但作为Mac用户,我的步骤略有不同:
pip uninstall rtree
brew install spatialindex
pip install rtree
https://stackoverflow.com/questions/67021748
复制相似问题