Skip to content

Frequent _tkinter.TclError when running test suite on Windows runners (GitHub Actions) #274

@stefmolin

Description

@stefmolin

The Windows runners often fail because tk isn't installed properly. Re-running the job usually results in a success, but it is very annoying. The failure happens when running the test suite, particularly when trying to plot with matplotlib:

This probably means that tk wasn't installed properly.
FAILED tests/data/test_loader.py::TestDataLoader::test_plot_available_datasets[None] - _tkinter.TclError: Can't find a usable tk.tcl in the following directories: 
    C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tcl8.6/tk8.6 C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6 C:/hostedtoolcache/windows/Python/3.11.9/lib/tk8.6 C:/hostedtoolcache/windows/Python/3.11.9/lib/tk8.6 C:/hostedtoolcache/windows/Python/lib/tk8.6 C:/hostedtoolcache/windows/Python/3.11.9/library

C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6/tk.tcl: couldn't read file "C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6/ttk/button.tcl": no such file or directory
couldn't read file "C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6/ttk/button.tcl": no such file or directory
    while executing
"source -encoding utf-8 [file join $::ttk::library button.tcl]"
    (file "C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6/ttk/ttk.tcl" line 100)
    invoked from within
"source -encoding utf-8 C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6/ttk/ttk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 [list source -encoding utf-8 $::ttk::library/ttk.tcl]"
    (file "C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6/tk.tcl" line 706)
    invoked from within
"source C:/hostedtoolcache/windows/Python/3.11.9/x64/tcl/tk8.6/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.
FAILED tests/plotting/test_static.py::test_plot[None] - _tkinter.TclError: invalid command name "tcl_findLibrary"

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci/cdRelating to local development or CI/CDhelp wantedExtra attention is neededtestingRelating to the testing suite

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions