Python: Difference between revisions
imported>Danbst No edit summary |
imported>Symphorien mention how to have pygobject work |
||
| Line 115: | Line 115: | ||
# ... | # ... | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Special Modules == | |||
=== Gnome === | |||
<code>gobject-introspection</code> based python modules need some environment variables to work correctly. For standalone | |||
applications, <code>wrapGAppsHook</code> (see {{pull|43150}} for the documentation) wraps the executable with the necessary variables. But this is not fit for development. | |||
In this case use a <code>nix-shell</code> with <code>gobject-intospection</code> and all the libraries you are using (gtk and so on) as <code>buildInputs</code>. | |||
For example: | |||
{{Commands|<nowiki>$ nix-shell -p gobjectIntrospection gtk3 'python2.withPackages (ps: with ps; [ pygobject3 ])' --run "python -c \"import pygtkcompat; pygtkcompat.enable_gtk(version='3.0')\""</nowiki>}} | |||
== External Documentation == | == External Documentation == | ||
* [https://nixos.org/nixpkgs/manual/#python Python user guide in nixpkgs manual] | * [https://nixos.org/nixpkgs/manual/#python Python user guide in nixpkgs manual] | ||