GNOME Bugzilla – Bug 709082
import errors in uninstalled setup
Last modified: 2014-09-24 17:24:06 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):
+ Trace 232553
from gi.repository import Gst, GObject
from ..importer import DynamicImporter
from .module import DynamicModule, DynamicGObjectModule, DynamicGLibModule
from .overrides import 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 ...
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.
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)
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?
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
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
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
Created attachment 286950 [details] [review] scripts: Handle gst-python in gst-uninstalled
Attachment 286950 [details] pushed as f978e9e - scripts: Handle gst-python in gst-uninstalled