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

你可能感兴趣的:(python包安装的坑,python,开发语言)