-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Matplotlib with enableQt = false will attempt to use Qt and if Qt is imported by another package #85046
Comments
isn't that a matplotlib issue ? they shouldn't rely on an absent backend |
I suspect matplotlib is detecting if it can import pyside, which is possible as pyside exist in this nix shell environment. However, if enableqt is explicitly false, the nix build of matplotlob shouldn't try to use it IMO. |
Sounds like a matplot issue to me as well. You see, according to matplotlib's nixpkgs/pkgs/development/python-modules/matplotlib/default.nix Lines 43 to 49 in d1295c4
I also tested the resulting outputs of matplotlib with and without qt using dirdiff and the only main difference is When This also conflicts with their docs: https://matplotlib.org/3.2.1/users/installing.html#install-requirements . Please report this upstream @shuhaowu . As for this error:
This is a known issue with pretty much every python library that requires certain environment to perform GUI stuff. See #25351 . See a possible fix in #83321 and discussions / broader ideas: |
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel. |
This is still an issue, I just bumped into it. EDIT: I realized this only happens in |
I marked this as stale due to inactivity. → More info |
I just tried plotting a figure with matplotlib default setting (no config files, no additional settings in Nix config), and it worked. I think it uses the tk backend. |
I too can confirm the issue is fixed. As mentioned earlier, this was an upstream issue IMO and it is fixed now so it seems. |
Has anyone reported it upstream? |
Is this an upstream issue? Is so, I do not think so. |
You can open a new issue if you still experience this issue, when we closed this, we weren't sure what exactly upstream did that fixed this, we just observed this is no longer an issue. |
Describe the bug
If you construct a nix-shell with matplotlib in its default setting (
enableTk = true; enableQt = false;
) with another app that depends on Qt, matplotlib will try to use the Qt backend unlessmatplotlib.use("TkAgg")
is called at the beginning of the Python code that you write.To Reproduce
Steps to reproduce the behavior:
import matplotlib.pyplot as plt; plt.figure()
Expected behavior
Matplotlib should use the TK backend.
Workaround
Add
to the top of the python script using matplotlib.
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: