Toblerity/rtree

rtree fails to import

nobodyatandnothing opened this issue · 1 comments

$ pip show rtree
Name: Rtree
Version: 0.9.7
Summary: R-Tree spatial index for Python GIS
Home-page: https://github.com/Toblerity/rtree
Author: Sean Gillies
Author-email: sean.gillies@gmail.com
License: MIT
Location: /home/gorn/.local/lib/python3.10/site-packages
Requires: 
Required-by: spyder
$ python 
Python 3.10.3 (main, Mar 18 2022, 10:07:49) [GCC 11.2.1 20220317 releases/gcc-11.2.0-863-g9baf563a17] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import rtree
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gorn/.local/lib/python3.10/site-packages/rtree/__init__.py", line 9, in <module>
    from .index import Rtree, Index  # noqa
  File "/home/gorn/.local/lib/python3.10/site-packages/rtree/index.py", line 6, in <module>
    from . import core
  File "/home/gorn/.local/lib/python3.10/site-packages/rtree/core.py", line 77, in <module>
    rt.Error_GetLastErrorNum.restype = ctypes.c_int
  File "/usr/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: python: undefined symbol: Error_GetLastErrorNum

Duplicate of #64

You need to install libspatialindex, e.g., apt install libspatialindex-dev