BUG: Code not running after installingPyGEOS
See original GitHub issue-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of geopandas.
-
(optional) I have confirmed this bug exists on the master branch of geopandas.
Code Sample, a copy-pastable example
world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
world.head()
Problem description
I have installed PyGEOS because my process is slow and I read this: Using the optional PyGEOS dependency. For a code that was working without PyGEOS, I get now a “UserWarning: The Shapely GEOS version (3.4.3-CAPI-1.8.3 r4285) is incompatible with the GEOS version PyGEOS was compiled with (3.8.1-CAPI-1.13.3). Conversions between both will be slow. shapely_geos_version, geos_capi_version_string” and “Process finished with exit code -1073741819 (0xC0000005)”.
Expected Output
The code should simply run faster than without PyGEOS, ideally. The output should be:
0 1 ... MULTIPOLYGON (((2546732.494 1193708.955, 25465...
1 2 ... MULTIPOLYGON (((2549140.721 1178014.176, 25493...
2 3 ... MULTIPOLYGON (((2595270.119 1251478.978, 25942...
3 4 ... POLYGON ((2692430.313 1281173.385, 2692994.572...
4 5 ... MULTIPOLYGON (((2686913.929 1272389.921, 26868...
5 6 ... POLYGON ((2662038.335 1237690.711, 2662272.506...
6 7 ... POLYGON ((2716299.544 1165466.590, 2716755.976...
Output of geopandas.show_versions()
Without PyGEOS:
SYSTEM INFO
-----------
python : 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
executable : C:\...\python.exe
machine : Windows-10-10.0.17763-SP0
GEOS, GDAL, PROJ INFO
---------------------
GEOS : None
GEOS lib : None
GDAL : 3.1.2
GDAL data dir: None
PROJ : 7.0.1
PROJ data dir: C:\...\lib\site-packages\pyproj\proj_dir\share\proj
PYTHON DEPENDENCIES
-------------------
geopandas : 0.8.1
pandas : 1.0.1
fiona : 1.8.16
numpy : 1.18.2
shapely : 1.7.1
rtree : 0.9.4
pyproj : 2.6.1.post1
matplotlib : 3.1.1
mapclassify: None
geopy : None
psycopg2 : None
geoalchemy2: None
pyarrow : None
None
With PyGEOS:
SYSTEM INFO
-----------
python : 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
executable : C:\...\python.exe
machine : Windows-10-10.0.17763-SP0
GEOS, GDAL, PROJ INFO
---------------------
GEOS : None
GEOS lib : None
GDAL : 3.1.2
GDAL data dir: None
PROJ : 7.0.1
PROJ data dir: C:\...\lib\site-packages\pyproj\proj_dir\share\proj
PYTHON DEPENDENCIES
-------------------
geopandas : 0.8.1
pandas : 1.1.1
fiona : 1.8.16
numpy : 1.19.1
shapely : 1.7.1
rtree : 0.9.4
pyproj : 2.6.1.post1
matplotlib : None
mapclassify: None
geopy : None
psycopg2 : None
geoalchemy2: None
pyarrow : None
None
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top GitHub Comments
Woohoo, it works when adding
shapely.speedups.disable()
with the minimal example! It also works with my larger project, and really really faster 👍Thank you very much! Great and super fast answer.
So then it might actually be a problem with the Shapely installation, and not with the use of pygeos or not. The Shapely speedup cython module is built against GEOS 3.8, but for some reason it is finding GEOS 3.4 in your environment.
Two things to try. Can you see if disabling shapely’s speed-ups solve it?
(and then running the code again)
Alternatively, a pure-Shapely reproducer migth be something like