[Nix-dev] Trouble with pygobject

Luca Bruno lethalman88 at gmail.com
Fri Oct 31 23:01:05 CET 2014


Put gtk, pango and gdk-pixbuf in the buildInputs.

On Fri, Oct 31, 2014 at 10:59 PM, Richard Wallace <
rwallace at thewallacepack.net> wrote:

> The nix expression was linked.
>
> I noticed that virt-manager is using pyobject3 so I tried changing to use
> that too, and I got further.  Now I'm getting
>
> ERROR:root:Could not find any typelib for Gtk
> ERROR:root:Could not find any typelib for Gdk
> ERROR:root:Could not find any typelib for Pango
> ERROR:root:Could not find any typelib for GdkPixbuf
> Traceback (most recent call last):
>   File
> "/nix/store/wm1ybs2040xxw8r7d4448qifjb0ckazg-python3.4-pithos-1.0.1/bin/..pithos-wrapped-wrapped",
> line 10, in <module>
>     load_entry_point('pithos==1.0.1', 'gui_scripts', 'pithos')()
>   File
> "/nix/store/kpcbbc1104jqd39njz1c709jlrmbkzfj-python3.4m-setuptools-5.8/lib/python3.4/site-packages/setuptools-5.8-py3.4.egg/pkg_resources.py",
> line 339, in load_entry_point
>     return get_distribution(dist).load_entry_point(group, name)
>   File
> "/nix/store/kpcbbc1104jqd39njz1c709jlrmbkzfj-python3.4m-setuptools-5.8/lib/python3.4/site-packages/setuptools-5.8-py3.4.egg/pkg_resources.py",
> line 2457, in load_entry_point
>     return ep.load()
>   File
> "/nix/store/kpcbbc1104jqd39njz1c709jlrmbkzfj-python3.4m-setuptools-5.8/lib/python3.4/site-packages/setuptools-5.8-py3.4.egg/pkg_resources.py",
> line 2171, in load
>     ['__name__'])
>   File
> "/nix/store/wm1ybs2040xxw8r7d4448qifjb0ckazg-python3.4-pithos-1.0.1/lib/python3.4/site-packages/pithos/pithos.py",
> line 26, in <module>
>     from gi.repository import Gst, GstPbutils, GObject, Gtk, Gdk, Pango,
> GdkPixbuf, Gio, GLib
> ImportError: cannot import name 'Gtk'
>
> so, progress, I guess?
>
> Rich
>
> On Fri, Oct 31, 2014 at 2:55 PM, Luca Bruno <lethalman88 at gmail.com> wrote:
>
>> What pygobject are using? Please write down the .nix expression.
>>
>> On Fri, Oct 31, 2014 at 10:45 PM, Richard Wallace <
>> rwallace at thewallacepack.net> wrote:
>>
>>> On Fri, Oct 31, 2014 at 12:05 PM, Bjørn Forsman <bjorn.forsman at gmail.com
>>> > wrote:
>>>
>>>> Hi Richard,
>>>>
>>>> On 31 October 2014 19:28, Richard Wallace <rwallace at thewallacepack.net>
>>>> wrote:
>>>> > Hey all,
>>>> [...]
>>>> > Now I'm trying to get pithos (a Pandora GTK client) built [1].  Pithos
>>>> > builds and everything looks ok, but when I try and run it I get
>>>> > `ImportError: No module named gi`.  I'm not familiar with Python
>>>> > development, but a bit of Googling indicates that python can't
>>>> pygobject.
>>>> >
>>>> > Looking at the wrapper created, I see the path to
>>>> >
>>>> `/nix/store/hlyp3a9cy5k7qhfc1chd1v3bm2jljazn-pygobject-2.28.6/lib/python2.7/site-packages`
>>>> > included in the PYTHONPATH.
>>>>
>>>> I think you need to add gobjectIntrospection to buildInputs, and then
>>>> wrap the executable with GI_TYPELIB_PATH set to GI_TYPELIB_PATH from
>>>> the build environment. See the virt-manager expression for example.
>>>>
>>>
>>> Thanks for the suggestion.  It seems to make sense, so I modified the
>>> package as you suggested [1]. Unfortunately I'm still getting the same
>>> error.
>>>
>>> The `pithos` script includes the line
>>>
>>>   export
>>> GI_TYPELIB_PATH=/nix/store/9imvrzskcak2998zj1242jxgl4p9m5dp-gst-plugins-base-1.4.1/lib/girepository-1.0:/nix/store/byi4j636s13m8w28nvqiakn6nzakmadr-gstreamer-1.4.1/lib/girepository-1.0:/nix/store/y06kp3fxw3r5r3nfkqzc8l3y7r3kvns0-libnotify-0.7.6/lib/girepository-1.0:/nix/store/4z6rr314xg1iszkn2wjvvl16yfmwgwa7-gobject-introspection-1.40.0/lib/girepository-1.0${GI_TYPELIB_PATH:+:}$GI_TYPELIB_PATH
>>>
>>> so it looks like it is doing what it is supposed to.
>>>
>>> Rich
>>>
>>> [1] http://pastebin.com/amAc8wpG
>>>
>>> _______________________________________________
>>> nix-dev mailing list
>>> nix-dev at lists.science.uu.nl
>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>
>>>
>>
>>
>> --
>> www.debian.org - The Universal Operating System
>>
>
>


-- 
www.debian.org - The Universal Operating System
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20141031/7d94db0c/attachment.html 


More information about the nix-dev mailing list