Toblerity/rtree

Python 3.10 wheels broken?

DianelaOB opened this issue · 4 comments

On Python 3.10 I get the following error when importing rtree.index:

    from rtree import index
  File "/home/dianela/.pyenv/versions/3.10.2/lib/python3.10/site-packages/rtree/__init__.py", line 9, in <module>
    from .index import Rtree, Index  # noqa
  File "/home/dianela/.pyenv/versions/3.10.2/lib/python3.10/site-packages/rtree/index.py", line 6, in <module>
    from . import core
  File "/home/dianela/.pyenv/versions/3.10.2/lib/python3.10/site-packages/rtree/core.py", line 77, in <module>
    rt.Error_GetLastErrorNum.restype = ctypes.c_int
  File "/home/dianela/.pyenv/versions/3.10.2/lib/python3.10/ctypes/__init__.py", line 387, in __getattr__
    func = self.__getitem__(name)
  File "/home/dianela/.pyenv/versions/3.10.2/lib/python3.10/ctypes/__init__.py", line 392, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /home/dianela/.pyenv/versions/3.10.2/bin/python: undefined symbol: Error_GetLastErrorNum

The wheels work fine for Python 3.9. The installed file is Rtree-0.9.7-cp310-cp310-linux_x86_64.whl

Where did you get the wheel file? It's not at PyPI for the latest release (0.9.7)

Maybe it's a defunct product of a local build pip ran from the 0.9.7 tarball since there are no 3.10 wheels on PyPI? Should we rerun the CI workflow with 3.10 enabled?

@DianelaOB your issue can be fixed by installing libspatialindex in a manner that CTypes can find it; for example by installing it through your distribution's package manager:

# Ubuntu/Debian example
sudo apt-get update; sudo apt-get install -y libspatialindex-dev
hobu commented

3.10 wheels being built by #206