Edit: I have tried importing almost every library represented in /usr/lib/girepository-1.0
through gi.repository
and they all work except Gtk and Gdk. I have updated the title to reflect this.
I need a self-built PyGObject library to go with my self-built Python 3.3.3. I installed all the dependencies for PyGObject using sudo apt-get build-dep python3-gi
. I found that the working system PyGObject version was 3.2.2, so I checked out version 3.2.2 of the source from the Git repo. I ran:
autoreconf --force --install ./configure --prefix=/home/tomas/.pyenv/versions/3.3.3 make make install
Everything compiled and installed beautifully. I opened a fresh CMD and set the working directory to ~
, then:
~$ python Python 3.3.3 (default, Dec 21 2013, 23:12:28) [GCC 4.6.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from gi.repository import Gtk Segmentation fault (core dumped) ~$
I have set LD_LIBRARY_PATH
to /home/tomas/.pyenv/versions/3.3.3/lib
and checked that the correct library is being loaded:
~$ ldd .pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/_gi.so linux-vdso.so.1 => (0x00007fffcdf51000) libgirepository-1.0.so.1 => /usr/lib/libgirepository-1.0.so.1 (0x00007f45d8304000) libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f45d80b5000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f45d7dbf000) libpyglib-gi-2.0-python.so.0 => /home/tomas/.pyenv/versions/3.3.3/lib/libpyglib-gi-2.0-python.so.0 (0x00007f45d7bba000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f45d799d000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f45d75dc000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f45d72e0000) libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f45d70dc000) libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f45d6d8c000) libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f45d6b84000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f45d6947000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f45d673e000) /lib64/ld-linux-x86-64.so.2 (0x00007f45d877b000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f45d653a000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f45d6323000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f45d6103000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f45d5ee7000)
I also imported the module with python -vv
: Pastebin
The last few lines reveals that the core dump happens right after importing gi.repository.Atk
:
# trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/repository/Atk.cpython-33m.so # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/repository/Atk.abi3.so # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/repository/Atk.so # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/repository/Atk.py # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/repository/Atk.pyc # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/overrides/Atk.cpython-33m.so # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/overrides/Atk.abi3.so # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/overrides/Atk.so # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/overrides/Atk.py # trying /home/tomas/.pyenv/versions/3.3.3/lib/python3.3/site-packages/gi/overrides/Atk.pyc import 'gi.repository.Atk' # Segmentation fault (core dumped)
Importing just gi.repository.Atk
doesn't segfault.
I have also tried removing the system version of the library (sudo dpkg -P python3-gi
) in case it was interfering in some way.
I don't know what else to do. Does anybody know or have any idea what the problem might be? Please leave a comment if you have an idea of something I could try or if I can provide more information.