栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compil

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compil

geopandas The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compiled with (3.10.0-CAPI-1.16.0) 问题:
>>> import geopandas
/lib/python3.8/site-packages/geopandas/_compat.py:84: UserWarning: The Shapely GEOS version (3.9.1-CAPI-1.14.2) is incompatible with the GEOS version PyGEOS was compiled with (3.10.0-CAPI-1.16.0). Conversions between both will be slow.
  warnings.warn(
解决办法:

1、卸载pygeo

pip uninstall pygeo
>>> import geopandas
Traceback (most recent call last):
  File "tif2geojson_isoband_v5_dissolve_clip_0_last.py", line 258, in 
    process(tif_file, result_path, sigma, each, levels)
  File "tif2geojson_isoband_v5_dissolve_clip_0_last.py", line 187, in process
    gpd_diff = gp.overlay(gpd_current,
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/tools/overlay.py", line 315, in overlay
    result = _overlay_difference(df1, df2)
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/tools/overlay.py", line 80, in _overlay_difference
    idx1, idx2 = df2.sindex.query_bulk(df1.geometry, predicate="intersects", sort=True)
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/base.py", line 2637, in sindex
    return self.geometry.values.sindex
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/array.py", line 292, in sindex
    self._sindex = _get_sindex_class()(self.data)
  File "/home/geovis/.local/lib/python3.8/site-packages/geopandas/sindex.py", line 21, in _get_sindex_class
    raise importError(
importError: Spatial indexes require either `rtree` or `pygeos`. See installation instructions at https://geopandas.org/install.html

2、安装rtree

pip install rtree
>>> import geopandas
>>> 
参考:

https://github.com/geopandas/geopandas/pull/1794

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/665117.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号