I am trying to clip spatial data in python but when I run my code...
europe = gpd.clip(worldmap, europe_bound_gdf)
... I get the error:
(ImportError: Spatial indexes require either
rtreeor
pygeos`.)
When I try to install rtree using:
pip3 install rtree
I'm told:
Requirement already satisfied: rtree in /Users/joshuajones/.pyenv/versions/3.9.4/lib/python3.9/site-packages (0.9.7`)
So why is my code not working?
I had the same issue and this solved it for me:
pip uninstall rtree
sudo apt install libspatialindex-dev
pip install rtree
Found the answer here.
In my case, the only thing that helped:
!pip install -q condacolab -q
import condacolab
condacolab.install()
!conda install geopandas
import geopandas as gpd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With