Skip to content

ImportError: Package 'textual.widgets' has no class 'TextLog'  #81

@gabriel-v

Description

@gabriel-v

This happens on the tests on main branch, here is a recent re-run of the CI and another run with the patch

After installing dev packages on a fresh venv, then running pytest, one gets this error:

================================================================== ERRORS ===================================================================
___________________________________________ ERROR collecting redun/tests/test_static_analysis.py ____________________________________________
ImportError while importing test module '/work/redun/redun/tests/test_static_analysis.py'.
Hint: make sure your test modules/packages have valid Python names.                                                                          
Traceback:                                                                                                                                   
/usr/lib/python3.11/importlib/__init__.py:126: in import_module                                                                              
    return _bootstrap._gcd_import(name[level:], package, level)                                                                              
redun/tests/test_static_analysis.py:21: in <module>                                                                                              for module in import_all_modules(redun)                
redun/tests/utils.py:466: in import_all_modules                                                                                                  modules.extend(import_all_modules(module))                                                                                               
redun/tests/utils.py:464: in import_all_modules
    module = importlib.import_module(full_name)
/usr/lib/python3.11/importlib/__init__.py:126: in import_module                                                                              
    return _bootstrap._gcd_import(name[level:], package, level)                                                                              redun/console/app.py:16: in <module>                               
    from redun.console.screens import (                                                                                                      redun/console/screens.py:17: in <module>                                                                                                     
    from textual.widgets import Footer, Input, Label, Static, TextLog
/home/gabriel/.local/share/virtualenvs/redun-gyVl-7AX/lib/python3.11/site-packages/textual/widgets/__init__.py:98: in __getattr__
    raise ImportError(f"Package 'textual.widgets' has no class '{widget_class}'")                                     
E   ImportError: Package 'textual.widgets' has no class 'TextLog'    

A quick google shows this: https://textual.textualize.io/FAQ/#no-widget-called-textlog

No widget called TextLog
The TextLog widget was renamed to RichLog in Textual 0.32.0.

The dev requirements don't explicitly list textual as a dependency, and pip installed version 0.36.0 for me. I added a pinned version of textual=0.31.0 to avoid this issue - see PR

I also had another error with pip trying out and rejecting all versions of pygraphviz -- so I pinned version 1.11 which was installed in the last test execution on github actions. But now tox complains about that version, it wants versions <=1.8 on the older python versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions