Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[BUG] sporadic matplotlib tkinter failures on windows #1747

Open
fkiraly opened this issue Jan 5, 2025 · 0 comments
Open

[BUG] sporadic matplotlib tkinter failures on windows #1747

fkiraly opened this issue Jan 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@fkiraly
Copy link
Collaborator

fkiraly commented Jan 5, 2025

There are sporadic failures related to matplotlib tkinter on windows, example traceback below.

These are sporadic and occur in perhaps one in 10-50 runs currently.

This is reminiscent of the following sporadic failure in sktime we had a while ago: sktime/sktime#2066, which looks like the same problem on superficial glance.
On sktime, I believe we never really diagnosed the issue, and simply added test skips on windows.

Example traceback, from https://github.com/sktime/pytorch-forecasting/actions/runs/12620582347/job/35166454483?pr=1746:

pytorch_forecasting\models\base_model.py:1231: in plot_prediction
    fig, ax = plt.subplots()
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\matplotlib\pyplot.py:1775: in subplots
    fig = figure(**fig_kw)
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\matplotlib\pyplot.py:1042: in figure
    manager = new_figure_manager(
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\matplotlib\pyplot.py:552: in new_figure_manager
    return _get_backend_mod().new_figure_manager(*args, **kwargs)
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\matplotlib\backend_bases.py:3501: in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\matplotlib\backend_bases.py:3506: in new_figure_manager_given_figure
    return cls.FigureCanvas.new_manager(figure, num)
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\matplotlib\backend_bases.py:1783: in new_manager
    return cls.manager_class.create_with_canvas(cls, figure, num)
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\matplotlib\backends\_backend_tk.py:507: in create_with_canvas
    window = tk.Tk(className="matplotlib")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tkinter.Tk object .>, screenName = None, baseName = '__main__'
className = 'matplotlib', useTk = True, sync = False, use = None

    def __init__(self, screenName=None, baseName=None, className='Tk',
                 useTk=True, sync=False, use=None):
        """Return a new top level widget on screen SCREENNAME. A new Tcl interpreter will
        be created. BASENAME will be used for the identification of the profile file (see
        readprofile).
        It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
        is the name of the widget class."""
        self.master = None
        self.children = {}
        self._tkloaded = False
        # to avoid recursions in the getattr code in case of failure, we
        # ensure that self.tk is always _something_.
        self.tk = None
        if baseName is None:
            import os
            baseName = os.path.basename(sys.argv[0])
            baseName, ext = os.path.splitext(baseName)
            if ext not in ('.py', '.pyc'):
                baseName = baseName + ext
        interactive = False
>       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:\hostedtoolcache\windows\Python\3.12.8\x64\tcl\tcl8.6}
E       
E       C:/hostedtoolcache/windows/Python/3.12.8/x64/tcl/tcl8.6/init.tcl: couldn't read file "C:/hostedtoolcache/windows/Python/3.12.8/x64/tcl/tcl8.6/init.tcl": No error
E       couldn't read file "C:/hostedtoolcache/windows/Python/3.12.8/x64/tcl/tcl8.6/init.tcl": No error
E           while executing
E       "source C:/hostedtoolcache/windows/Python/3.12.8/x64/tcl/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.
@fkiraly fkiraly added the bug Something isn't working label Jan 5, 2025
@github-project-automation github-project-automation bot moved this to Needs triage & validation in Bugfixing - pytorch-forecasting Jan 5, 2025
@fkiraly fkiraly moved this from Needs triage & validation to Reproduced/confirmed in Bugfixing - pytorch-forecasting Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Reproduced/confirmed
Development

No branches or pull requests

1 participant