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 709082 - import errors in uninstalled setup
import errors in uninstalled setup
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Linux
: Normal major
: 1.4.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-30 11:14 UTC by Tim-Philipp Müller
Modified: 2014-09-24 17:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scripts: Handle gst-python in gst-uninstalled (1.31 KB, patch)
2014-09-24 08:20 UTC, Thibault Saunier
committed Details | Review

Description Tim-Philipp Müller 2013-09-30 11:14:02 UTC
I get import errors with gst-python in gst-uninstalled:

tpm@zingle:~/gst/master/code/test-volume$ python test-volume.py  ES_04-1er_Essai_Musique1.wav 
['/home/tpm/gst/master/gst-python/gi/overrides', '/usr/lib/python2.7/dist-packages/gi/overrides'] gi.overrides
Traceback (most recent call last):
  • File "test-volume.py", line 6 in <module>
    from gi.repository import Gst, GObject
  • File "/usr/lib/python2.7/dist-packages/gi/repository/__init__.py", line 25 in <module>
    from ..importer import DynamicImporter
  • File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 28 in <module>
    from .module import DynamicModule, DynamicGObjectModule, DynamicGLibModule
  • File "/usr/lib/python2.7/dist-packages/gi/module.py", line 34 in <module>
    from .overrides import registry
ImportError: cannot import name registry


tpm@zingle:~/gst/master/code/test-volume$ echo $PYTHONPATH
/home/tpm/gst/master/insanity:/home/tpm/gst/master/gst-python:/home/tpm/gst/master/prefix/lib/python2.7/site-packages


tpm@zingle:~/gst/master/code/test-volume$ PYTHONPATH= python test-volume.py  ES_04-1er_Essai_Musique1.wav 
here
here
...
Comment 1 Thibault Saunier 2013-09-30 11:35:59 UTC
Basically the issue is that we use extend_path to be able to have various paths with different root for overrides/ but if we do not have the PyGobject one imported first, then it does not work.

You need to make sure that in your PYTHONPATH, the path to pygobject is before the gst-python one.
Comment 2 Thibault Saunier 2014-06-09 09:15:43 UTC
Tim could you check that it does not happen if you set your PYTHONPATH in the right order? (I know it is not ideal but it is a limitation of the solution we found to be able to have overrides splitted in several directories)
Comment 3 Tim-Philipp Müller 2014-06-09 09:45:42 UTC
I'm not sure what you are asking. I'm using gst-uninstalled unmodified, and python/pygobject from packages.

You want me to prefix PYTHONPATH with the system directories where pygobject is installed?
Comment 4 Thibault Saunier 2014-06-09 09:51:27 UTC
Yes, this is what we do in pitivi-git-env (some 'fork' of gst-uninstalled)

https://git.gnome.org/browse/pitivi/tree/bin/pitivi-git-environment.sh#n55
Comment 5 Edward Hervey 2014-07-03 11:46:52 UTC
I confirm I get the exact same issue.

It's trivial to trigger with : python -c "import gi.repository"

I tried to patch gst-uninstalled in a similar vein to pitivi-git-environment but ... gi doesn't have _overridesdir here
Comment 6 A Ashley 2014-08-27 15:30:38 UTC
To get uninstalled to work, I had to change gst-uninstalled to:

    export PYTHONPATH="${PYTHONPATH}:/usr/lib/python${pythonver}/dist-packages:/usr/lib/python${pythonver}/site-packages:${GST_PREFIX}/lib/python${pythonver}/site-packages:${GST}/gst-python"
    export GI_TYPELIB_PATH=/usr/lib/girepository-1.0/:/usr/local/lib/girepository-1.0
Comment 7 Thibault Saunier 2014-09-24 08:20:12 UTC
Created attachment 286950 [details] [review]
scripts: Handle gst-python in gst-uninstalled
Comment 8 Thibault Saunier 2014-09-24 17:19:24 UTC
Attachment 286950 [details] pushed as f978e9e - scripts: Handle gst-python in gst-uninstalled