2

I am using Shapely, geopandas and pygeos and get the following warning:

UserWarning: The Shapely GEOS version (3.10.2-CAPI-1.16.0) is incompatible with the GEOS version PyGEOS was compiled with (3.10.1-CAPI-1.16.0). Conversions between both will be slow.

The respective versions are:

Shapely                  1.8.2
geopandas                0.10.2
pygeos                   0.12.0

Question:

Can I solve this issue by upgrading / downgrading one of the versions? I was not able to find a list of compatible versions.

M_M246
  • 65
  • 7
  • Try `conda`. Usually, it checks compatibility. If this is the true, you can reinstall your current packages in your work environment. – Vovin Jul 01 '22 at 07:19
  • conda recommends to install geopandas 0.11.0 - the other versions are unchanged. However, this results in the same warning – M_M246 Jul 01 '22 at 11:51
  • As `shapely` has its own **GEOS** installed, you could just uninstall `pygeos` or reinstall shapely, set *GEOS_CONFIG* environment variable to **GEOS** from `pygeos`. – Vovin Jul 01 '22 at 12:54

1 Answers1

2

The following solution (originally posted here) worked for me:

pip install --force-reinstall --no-binary shapely shapely

If encounter OSError: /home/users/xxx/miniconda3/envs/nuplan/lib/libgeos_c.so: cannot open shared object file: No such file or directory, then do

conda install -c conda-forge pygeos

to fix the missing library problem eventually you have to do (not necessary in my case)

export LD_LIBRARY_PATH=$LD_LIBARRY_PATH:$HOME/miniconda3/env/nuplan/lib

M_M246
  • 65
  • 7