首页 > 解决方案 > 在 Google Cloud AI 平台上安装 libspatialindex

问题描述

我正在尝试在 python 中导入 rtree

导入时出现此错误

OSError: Could not find libspatialindex_c library file

在线研究它说我需要在 Jupyter 中运行 !pip install libspatialindex 时安装 libspatialindex,我收到此错误

Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement libspatialindex (from versions: none)
ERROR: No matching distribution found for libspatialindex

在这里研究https://libspatialindex.org/它说要安装 conda 并运行它

conda install -c conda-forge libspatialindex=1.9.3

conda 目前不在 AI 平台笔记本上。不知道怎么安装,没看到网上有关于在AI平台上安装的说明

最好的下一步是什么?谢谢

标签: pythongoogle-cloud-platformr-treegcp-ai-platform-notebooklibspatialindex

解决方案


我按照此链接中的说明,将它们粘贴到 jupyterlab 中的终端中,并将前两个代码块粘贴到终端中。然后你就可以导入 rtree https://github.com/libspatialindex/libspatialindex/wiki/1.-Getting-Started


推荐阅读