NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.38k stars 13.6k forks source link

matplotlib is missing GSettings #25351

Open rnhmjoj opened 7 years ago

rnhmjoj commented 7 years ago

Issue description

When opening the file picker of a matplotlib (gtk3 backend) window the process crashes with this error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system I think it needs wrapGAppsHook but I'm not really sure how that works.

Steps to reproduce

$ nix-shell -p 'pythonPackages.matplotlib.override {enableGtk3=true;}' --run 'python -c "import matplotlib.pyplot as plt; plt.plot([1,2,3],[4,5,6]); plt.show()"'

Technical details

NixOS version: 17.09pre106117.c90998d5cf

rnhmjoj commented 7 years ago

Reading https://github.com/NixOS/nixpkgs/issues/24880 I tried adding to the buildInputs wrapGAppsHook and gsettings_desktop_schemas but it didn't help. Anyone knows how to fix it?

mmahut commented 5 years ago

Any news on this issue?

rnhmjoj commented 5 years ago

Nothing new: It's still happening. Also the package probably has to be wrapped for #65399 . I have no idea how to to do that on a python library, though.

doronbehar commented 4 years ago

I've just solved this error in an end user application - https://github.com/NixOS/nixpkgs/pull/84449 The solution is to use wrapGAppsHook which adds something like this to the wrapper:

export XDG_DATA_DIRS='/nix/store/nwksqszw0dakmizrrlql9pamcf39vnxg-gtk+3-3.24.14/share/gsettings-schemas/gtk+3-3.24.14:/nix/store/slmsmbyfgf1rqj9rp6s1y33cqaz8q203-gsettings-desktop-schemas-3.34.0/share/gsettings-schemas/gsettings-desktop-schemas-3.34.0:/nix/store/nwksqszw0dakmizrrlql9pamcf39vnxg-gtk+3-3.24.14/share/gsettings-schemas/gtk+3-3.24.14:/nix/store/slmsmbyfgf1rqj9rp6s1y33cqaz8q203-gsettings-desktop-schemas-3.34.0/share/gsettings-schemas/gsettings-desktop-schemas-3.34.0'${XDG_DATA_DIRS:+':'}$XDG_DATA_DIRS
export XDG_DATA_DIRS='/nix/store/92p57svcsqgwa5fgb8z9qg7m7r66nx7a-guvcview-2.0.6/share'${XDG_DATA_DIRS:+':'}$XDG_DATA_DIRS

To solve this issue in the context of using matplotlib is somewhat challenging because matplotlib is a library - what exactly would we wrap? https://github.com/NixOS/nixpkgs/pull/83321 is exactly what we need.

rnhmjoj commented 4 years ago

@doronbehar Sadly there is no way, yet. The situation will hopefully change once structured attributes are enabled in nixpkgs and declarative wrappers are implemented. See this issue #72074.

what exactly would we wrap? #83321 is exactly what we need.

Yes, I tried implementing a temporary solution with #83321 because this will take a while before it's usable. It needs some feedback and a lot of testing but it should be working.

stale[bot] commented 3 years ago

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.

doronbehar commented 3 years ago

Still an issue.

On Oct 4 2020, at 7:25 pm, stale[bot] notifications@github.com wrote:

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 (https://git-scm.com/docs/git-blame) or GitHub's web interface (https://docs.github.com/en/github/managing-files-in-a-repository/tracking-changes-in-a-file) on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum (https://discourse.nixos.org/) or at #nixos' IRC channel (https://webchat.freenode.net/#nixos). — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/NixOS/nixpkgs/issues/25351#issuecomment-703279898), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ACT5IM2JBIHEXHRFMHH5ZILSJCOWRANCNFSM4DJSM7HA).

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

rnhmjoj commented 3 years ago

Still an issue.

nixos-discourse commented 2 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/jupyter-breaks-matplotlib/15468/2

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info

rnhmjoj commented 2 years ago

Still an issue, sadly.

charmoniumQ commented 1 year ago

Is this blocked by RFC 0075?

rnhmjoj commented 1 year ago

Not really, it's possible to fix these issues without a unified wrapping mechanism. See https://github.com/NixOS/nixpkgs/pull/102949#issuecomment-1587237994

Artturin commented 1 year ago

some patching to make XDG_DATA_DIRS contain schemas before https://github.com/matplotlib/matplotlib/blob/a861b8af82cc4618e0a631e5eac5b4030b3f04a1/lib/matplotlib/backends/backend_gtk3.py#L340 could help

jtojnar commented 1 year ago

I think the simplest solution would be hardcoding the schema path in GTK itself. We now have semi-automated patch generating tooling (see evolution-data-server package for an example), I just have not gotten around to applying it to GTK yet.

nixos-discourse commented 3 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/error-when-trying-to-use-pyqt5-backend-of-matplotlib/46065/4