-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Matplotlib selects TkAgg backend on LXC containers #29713
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
Comments
It looks like that test is explicitly setting tkagg as the backend but we are not detecting that there is a usable x11 or wayland session. The fix is to either to not force a GUI backend or provide a graphical environment in the container. |
No, that's not the case. I cloned the repo in question, and tried to (case insensitive) grep for TkAgg and found no results. Another example is: https://ci.debian.net/packages/b/bmtk/unstable/amd64/58413274/ and the corresponding repo https://github.com/AllenInstitute/bmtk Given that the same version worked fine with matplotlib 3.8.3 in the same environment, I suppose this would be a regression w the new version. |
I'm not certain yet, but I think there is a case-sensitivity mismatch at the following location that has a change-in-behaviour between v3.8.3 and v3.10.0: matplotlib/lib/matplotlib/pyplot.py Lines 2717 to 2725 in 8d64f03
When testing those versions comparatively in Debian containers, I find the
or
(hence a different comparison result -- and hence a different |
I've opened #29721 with a minimal repro that I've used to confirm this, and also a fix that I've tested locally. Unit test coverage is not yet provided. An alternative approach would be to rename some of the internal backend identifiers in |
Ping @ianthomas23 |
@nileshpatra aha; I think I might have uncovered the place where the |
Hi @jayaddison thanks for your work on this. However, even version 3.8.3 had the same line, cf: https://sources.debian.org/src/matplotlib/3.8.3-7/debian/rules/#L58 Even all versions before that also had the same line, see https://sources.debian.org/src/matplotlib/3.6.3-1/debian/rules/#L156 But I did not see autopkgtest failing then 😅 |
@jayaddison This is the log with bmtk version 1.1.1+ds-4 with matplotlib 3.8.3-7 https://ci.debian.net/packages/b/bmtk/unstable/amd64/58714318/ and this is with 3.10.0 https://ci.debian.net/packages/b/bmtk/unstable/amd64/58555849/ The test_plot_traces tests fail with new version and the same thing was working w an older version. |
This is the diff b/w older matplotlibrc and newer one, if this helps. I wonder if there's a change in the handling of backend in newer version?
|
I think there are three things that should be done here:
While this has exposed a bug, I think it has been been latent for a while because most packagers have stopped forcing the default backend. The fastest way out of this problem is 3. If the "we" in the OP is debian then you should definitely do 1. We will also fix the bug, but I do not think it is the sort of bug that would drive an emergency release as there are multiple ways (that are technically better!) to avoid the problem. |
I tend to agree -- I am actually confused as to why this was ever needed. I took this package over from the previous maintainer recently and this was left unchanged until now.
All I can guess is that things used to work differently in this very old version. There's also an associated patch with this: https://sources.debian.org/src/matplotlib/3.8.3-7/debian/patches/20_matplotlibrc_path_search_fix.patch/ And it likely makes sense to keep it for now, due to distro-specific location of those paths.
I see.
I can always incorporate a patch in debian and make a release, no need for you (upstream) to cut a release immediately :) |
I think you can drop just the |
Yes, I understood that -- I'll give that a try on Sunday afternoon. Meanwhile it'd also be good to get |
This issue has closed because of PR #29721 fixing the Matplotlib bug. Feel free to reopen if there is more to discuss. |
Bug summary
Hi,
We are updating matplotlib version from 3.8.3 to 3.10.0 and in the process, we see failures of the kind:
An example log is here: https://ci.debian.net/packages/g/gudhi/unstable/amd64/58337026/
This was working fine with matplotlib 3.8.3 version. The tests are running in a lxc container, AFAICS.
Code for reproduction
Actual outcome
Failing inside the container
Expected outcome
Passing inside the container
Additional information
No response
Operating system
Debian Unstable
Matplotlib Version
3.10.0
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: