安装“ libspatialIndex-dev”在jupyter上

发布于 2025-02-01 01:26:30 字数 512 浏览 2 评论 0 原文

我正在尝试使用geopandas进行内部空间连接,其中 poly 都是geodataframes。

instersection = gpd.sjoin(points, poly, how='inner')

但是,它引发了以下错误的错误 空间索引要求`rtree'或`Pygeos`

我知道这是因为没有安装 libspatialIndex-dev (请参阅 libspatialIndex和rtree in python ),但是 sudo apt apt apt Install ...

我如何在jupyter笔记本上安装它?

I am trying to conduct an inner spatial join using Geopandas, where both points and poly are Geodataframes.

instersection = gpd.sjoin(points, poly, how='inner')

However it is throwing up the error of:
Spatial indexes require either `rtree` or `pygeos`

I am aware it is do with not having installed libspatialindex-dev (see libspatialindex and Rtree on python), but none of the sudo apt install ... method works on Jupyter.

How am I able to install it on Jupyter notebook?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荆棘i 2025-02-08 01:26:30

如果您使用的是Google COLAB笔记本,您可以找到此链接有用:

我运行了上述笔记本,并能够成功安装rtree。

虽然这也可能很有帮助:

在您的jupyter单元格上运行以下内容:

!apt-get install -y libspatialindex-dev

If you are using Google Colab notebook you can find this link to be helpful:

https://colab.research.google.com/drive/1N7i9zmOwVcUzd4eHWZux4p_WTBMZHi8C

I ran the above notebook and was able to successfully install rtree.

While this may be helpful as well:

On your Jupyter cell run this:

!apt-get install -y libspatialindex-dev
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文