Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

matplotlib test use non-interactive agg backend #4168

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Nov 12, 2024

Summary

The last, Agg, is a non-interactive backend that can only write to files. It is used on Linux, if Matplotlib cannot connect to either an X display or a Wayland display.

The names of builtin backends are case-insensitive; e.g., 'QtAgg' and 'qtagg' are equivalent.

The tk backend might emit intermittent failures like:

>       self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
E       _tkinter.TclError: invalid command name "tcl_findLibrary"

Or:

>       self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
E       _tkinter.TclError: Can't find a usable init.tcl in the following directories: 
E           C:/Users/runneradmin/micromamba/envs/pmg/Library/lib/tcl8.6 C:/Users/runneradmin/micromamba/envs/lib/tcl8.6 C:/Users/runneradmin/micromamba/lib/tcl8.6 C:/Users/runneradmin/micromamba/envs/library C:/Users/runneradmin/micromamba/library C:/Users/runneradmin/micromamba/tcl8.6.13/library C:/Users/runneradmin/tcl8.6.13/library
E       
E       C:/Users/runneradmin/micromamba/envs/pmg/Library/lib/tcl8.6/init.tcl: couldn't read file "C:/Users/runneradmin/micromamba/envs/pmg/Library/lib/tcl8.6/init.tcl": No error
E       couldn't read file "C:/Users/runneradmin/micromamba/envs/pmg/Library/lib/tcl8.6/init.tcl": No error
E           while executing
E       "source C:/Users/runneradmin/micromamba/envs/pmg/Library/lib/tcl8.6/init.tcl"
E           ("uplevel" body line 1)
E           invoked from within
E       "uplevel #0 [list source $tclfile]"
E       
E       
E       This probably means that Tcl wasn't installed properly.

@DanielYang59 DanielYang59 marked this pull request as ready for review November 12, 2024 09:13
@shyuep shyuep merged commit d302920 into materialsproject:master Nov 12, 2024
43 checks passed
@DanielYang59 DanielYang59 deleted the mpl-agg-backend branch November 13, 2024 01:43
bilke added a commit to ufz/ogstools that referenced this pull request Jan 22, 2025
Fixes FAILED tests/test_plot.py::TestPlotting::test_save_animation - _tkinter.TclError: invalid command name "tcl_findLibrary"

See e.g. materialsproject/pymatgen#4168
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants