Missing dependancies of rtree

Please execute the following command if you are using Anaconda:

conda install -c conda-forge rtree=0.9.3

Though I had rtree version 0.9.7, Spyder couldn't detect it. So I had to manually downgrade it.


Came here with same problem, I don't use conda and could not install libspatialindex with pipenv:

# macOS Mojave 10.14.5
# python 3.7.4 (via pyenv)

Error: Command "python setup.py egg_info" failed with error code 1 in /var/folders/r7/2sx1wsvx0gj5x43wkmymg61w0000gq/T/tmpn09357tzbuild/rtree/

Found solution — install spatialindex via Homebrew:

brew install spatialindex

Then pipenv install rtree succeeded and now geopandas works smoothly
Hope it'll help


I encountered this same problem and tried to all the solutions shown in this page. But failed.

Finally, i find the solution that is...

  1. run the anaconda-navigator at the base.
  2. Click and activate the environment what you want to fix
  3. At the right search bar, type the 'rtree' and you can see the installed 'rtree' which has the version at 0.9.3 maybe.
  4. Click the small green checkbox on the left of 'rtree' in Name tab then put your mouse cursor over the 'mask for specific installation' menu.
  5. Click version '0.8.3' to downgrade via the anaconda-navigator.

after then, i executed spyder and the error message disappeared.


It looks like Rtree requires libspatialindex (https://libspatialindex.org) which is not automatically installed. It seems some devs are aware of the problem and working on a fix:

https://github.com/Toblerity/rtree/issues/146 https://github.com/Toblerity/rtree/issues/147

Tags:

Python

Spyder