After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790123 - Importing Gst from gi.repository fails with gst_uninstalled setup
Importing Gst from gi.repository fails with gst_uninstalled setup
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-09 14:59 UTC by Florent Thiéry
Modified: 2017-11-13 14:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Florent Thiéry 2017-11-09 14:59:07 UTC
I just setup a new gst-uninstalled environment using:

curl https://cgit.freedesktop.org/gstreamer/gstreamer/plain/scripts/create-uninstalled-setup.sh | sh
ln -sf ~/gst/master/gstreamer/scripts/gst-uninstalled ~/gst-master
echo "Run: ./gstreamer/scripts/git-update.sh"
~/gst-master

I run git-update, and after building i check that it works with gst-inspect etc.
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.13.0
GStreamer 1.13.0 (GIT)

Then, from within gst-master, running the following fails:

$ cat test.py 
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from gi.repository import Gst

$ python test.py 
Traceback (most recent call last):
  • File "test.py", line 3 in <module>
    from gi.repository import Gst
  • File "<frozen importlib._bootstrap>", line 961 in _find_and_load
  • File "<frozen importlib._bootstrap>", line 950 in _find_and_load_unlocked
  • File "<frozen importlib._bootstrap>", line 646 in _load_unlocked
  • File "<frozen importlib._bootstrap>", line 616 in _load_backward_compatible
  • File "/usr/lib/python3.6/site-packages/gi/importer.py", line 146 in load_module
    dynamic_module = load_overrides(introspection_module)
  • File "/usr/lib/python3.6/site-packages/gi/overrides/__init__.py", line 125 in load_overrides
    override_mod = importlib.import_module(override_package_name)
  • File "/usr/lib/python3.6/importlib/__init__.py", line 126 in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  • File "/usr/lib/python3.6/site-packages/gi/overrides/Gst.py", line 581 in <module>
    real_functions = [o for o in inspect.getmembers(Gst) if isinstance(o[1], type(Gst.init))]
  • File "/usr/lib/python3.6/inspect.py", line 342 in getmembers
    value = getattr(object, key)
  • File "/usr/lib/python3.6/site-packages/gi/module.py", line 154 in __getattr__
    assert g_type == TYPE_NONE AssertionError

For what it's worth, i'm running on Arch, with:
* python-gobject 3.26.0
* gst-python 1.12.3 (i also tried with git gst-python built in /home/ubicast/gst/master/gst-python)

$ echo $PYTHONPATH
:/usr/lib/python3.6/site-packages:/home/ubicast/gst/master/gst-python
Comment 1 Mathieu Duponchelle 2017-11-09 15:15:37 UTC
That's surprising, have you tried using gst-build ?
Comment 2 Florent Thiéry 2017-11-09 16:11:14 UTC
Just did, same issue. I'll triple check
Comment 3 Florent Thiéry 2017-11-09 16:14:42 UTC
I see there is no gst-python being built by gst-build, is it supposed to support this as well in the uninstalled environment ?
Comment 4 Florent Thiéry 2017-11-09 16:41:37 UTC
Looks like i'm not having the issue on another system, i'll try to find out how it differs.
Comment 5 Mathieu Duponchelle 2017-11-09 17:50:46 UTC
(In reply to Florent Thiéry from comment #3)
> I see there is no gst-python being built by gst-build, is it supposed to
> support this as well in the uninstalled environment ?

Yes it is, you need to pass -Denable_python=yes at meson build or meson conf time to get it (not sure why this isn't done by default)
Comment 6 Thibault Saunier 2017-11-09 17:59:32 UTC
gst-python is properly integrated into the gst-build uninstalled env.
Comment 7 Florent Thiéry 2017-11-10 10:48:28 UTC
Thanks, btw the exect syntax was

$ meson build -Denable_python=true
Comment 8 Florent Thiéry 2017-11-10 16:54:50 UTC
Basically my failing system was missing the gobject-introspection package. Installing it does make it work.

1) how come can i use gstreamer from python without the gobject-introspection package (outside of the uninstalled environment)? My app uses gi and gstreamer, and works without gobject-introspection being installed (but it has python-gobject and gst-python)

2) should not meson complain louder about missing gobject-introspection ? Even drop python being built ?
Comment 9 Mathieu Duponchelle 2017-11-13 14:28:20 UTC
(In reply to Florent Thiéry from comment #8)
> Basically my failing system was missing the gobject-introspection package.
> Installing it does make it work.
> 
> 1) how come can i use gstreamer from python without the
> gobject-introspection package (outside of the uninstalled environment)? My
> app uses gi and gstreamer, and works without gobject-introspection being
> installed (but it has python-gobject and gst-python)
> 

If you have the gir, typelib files and pygobject, then you can use these without needing gobject-introspection, which is only a build time dependency for these files

> 2) should not meson complain louder about missing gobject-introspection ?

Possibly :)

> Even drop python being built ?

Well the python overrides only depend on the pygobject headers, if you have those
then it can build its C extensions