acsresearch / interlab

MIT License
17 stars 3 forks source link

Error on import of treetrace in with python 3.12.3 #69

Closed gavento closed 1 month ago

gavento commented 2 months ago

Importing treetrace (directly or via importing interlab) on Python 3.12.3 (Ubuntu 24.04) raises the following error. Interlab version is interlab 0.4.1, installed via poetry in a virtual environment. Importing interlab and treetrace work fine in Python 3.10.14 and Python 3.11.9.

Python 3.12.3 (main, Apr 10 2024, 05:33:47) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import treetrace
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gavento/proj/ai-ai-bias/.venv/lib/python3.12/site-packages/treetrace/__init__.py", line 12, in <module>
    from .ui.console_server import ConsoleServer
  File "/home/gavento/proj/ai-ai-bias/.venv/lib/python3.12/site-packages/treetrace/ui/console_server.py", line 13, in <module>
    from .server_handle import PATH_TO_STATIC_FILES, ServerHandle
  File "/home/gavento/proj/ai-ai-bias/.venv/lib/python3.12/site-packages/treetrace/ui/server_handle.py", line 8, in <module>
    from .staticfiles import PATH_TO_STATIC_FILES
  File "/home/gavento/proj/ai-ai-bias/.venv/lib/python3.12/site-packages/treetrace/ui/staticfiles.py", line 6, in <module>
    with resources.path(browser, ".") as static_path:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/resources/_legacy.py", line 25, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/resources/_legacy.py", line 120, in path
    return _common.as_file(_common.files(package) / normalize_path(resource))
                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  File "/usr/lib/python3.12/importlib/resources/abc.py", line 133, in __truediv__
    return self.joinpath(child)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/resources/readers.py", line 92, in joinpath
    return super().joinpath(*descendants)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/resources/abc.py", line 117, in joinpath
    target = next(names)
             ^^^^^^^^^^^
StopIteration
>>> 
gavento commented 2 months ago

@spirali Would you know what is up with this bug? It is quite serious, as it is a blocker for even importing any part of interlab.