Toblerity/rtree

rtree broken with Python 3.8.8

sweettyler opened this issue · 6 comments

When I tried to import rtree, I got the following error:

Python 3.8.8 (default, Feb 24 2021, 21:46:12)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.21.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import rtree

AttributeError Traceback (most recent call last)
in
----> 1 import rtree

~/anaconda3/lib/python3.8/site-packages/rtree/init.py in
----> 1 from .index import Rtree
2
3 from .core import rt
4
5 version = '0.9.4'

~/anaconda3/lib/python3.8/site-packages/rtree/index.py in
4 import pprint
5
----> 6 from . import core
7
8 import pickle

~/anaconda3/lib/python3.8/site-packages/rtree/core.py in
141 raise RTreeError('Unsupported OS "%s"' % os.name)
142
--> 143 rt.Error_GetLastErrorNum.restype = ctypes.c_int
144
145 rt.Error_GetLastErrorMsg.argtypes = []

~/anaconda3/lib/python3.8/ctypes/init.py in getattr(self, name)
392 if name.startswith('') and name.endswith(''):
393 raise AttributeError(name)
--> 394 func = self.getitem(name)
395 setattr(self, name, func)
396 return func

~/anaconda3/lib/python3.8/ctypes/init.py in getitem(self, name_or_ordinal)
397
398 def getitem(self, name_or_ordinal):
--> 399 func = self._FuncPtr((name_or_ordinal, self))
400 if not isinstance(name_or_ordinal, int):
401 func.name = name_or_ordinal

AttributeError: ~/anaconda3/bin/python: undefined symbol: Error_GetLastErrorNum

In [2]: quit

I found this because my Spyder stopped working after some Anaconda updated Python from 3.8.5 to 3.8.8. Please refer ContinuumIO/anaconda-issues#12301 for some more detail.

Not quite sure if this is a rtree's bug or Python's.

Same here. Got it to work again by downgrading Python to 3.8.6. I'm using conda-forge to install Python and rtree.

hobu commented

I can't fix this bug without details that discriminate why 3.8.8 is behaving any different than 3.8.6.

@hobu you can close this ticket as Anaconda has released a new Python 3.8.8 (v5) and this issue has been fixed.

hobu commented

you can close this ticket as Anaconda has released a new Python 3.8.8 (v5) and this issue has been fixed.

Do you have a link to the ticket or reason why 3.8.8 did something different to fix this issue that was shown in Rtree? Just curious why Rtree was impacted.

I did report the bug to them but as of today I haven't gotten any response.