Red Hat Bugzilla – Bug 1474097
[python2-debug] unable to import "gi" module
Last modified: 2017-08-07 14:38:58 EDT
Description of problem:
python2-debug cannot run ordinary code which runs fine from python2 binary.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. run `$ python2-debug`
2. in python2, run `>>> from gi.repository import Gtk`
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name _gi
It should work fine, as it does in "normal" python2.
The debug build has a different C API, so any C extensions (such as _gi) will not work with it.
If you need to debug _gi, you'll need to build it from source against python-debug.
Feel free to ask for clarifications or reopen the bug if that didn't help!
(In reply to Petr Viktorin from comment #1)
> The debug build has a different C API, so any C extensions (such as _gi)
> will not work with it.
Thanks for your explanation and sorry for the noise.