Die Erhöhung der Ausführlichkeit des Interpreten trägt wesentlich dazu bei, dieses Problem zu lösen. Trotz alledem habe ich versucht, einen einfachen Symlink des 2.7 dist-Pakets zu meinem usr / local 3.x dist-Paket zu erstellen und bin ein wenig weiter gekommen, aber nicht viel.
sudo ln -s /usr/lib/python2.7/dist-packages/gi/ /usr/local/lib/python3.2/dist-packages
~ $ python3
Python 3.2.2+ (Standardeinstellung, 16. Februar 2012, 19:05:44)
[GCC 4.6.2] unter Linux2
Geben Sie "help", "copyright", "credits" oder "license" ein, um weitere Informationen zu erhalten.
>>> gi importieren
Rückverfolgung (letzter Anruf zuletzt):
Datei "", Zeile 1, in
Datei "/usr/local/lib/python3.2/dist-packages/gi/__init__.py", Zeile 23, in
aus ._gi importieren _API, Repository
ImportError: /usr/lib/libpyglib-gi-2.0-python2.7.so.0: undefiniertes Symbol: _Py_ZeroStruct
Wenn Sie das fehlende Symbol finden, können Sie dieses Problem möglicherweise lösen. Hier ist die ganze ausführliche Importausgabe, die mich bis hierher geführt hat. Dies scheint auch relevant zu sein: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=645963 , Viel Glück.
>>> gi importieren
# try gi.cpython-32mu.so
# try gimodule.cpython-32mu.so
# try gi.abi3.so
# try gimodule.abi3.so
# versuchen, gi.so
# try gimodule.so
# versuchen, gi.py
# versuchen, gi.pyc
# trying /usr/lib/python3.2/gi.cpython-32mu.so
# trying /usr/lib/python3.2/gimodule.cpython-32mu.so
# try /usr/lib/python3.2/gi.abi3.so
# trying /usr/lib/python3.2/gimodule.abi3.so
# try /usr/lib/python3.2/gi.so
# try /usr/lib/python3.2/gimodule.so
# try /usr/lib/python3.2/gi.py
# try /usr/lib/python3.2/gi.pyc
# trying /usr/lib/python3.2/plat-linux2/gi.cpython-32mu.so
# trying /usr/lib/python3.2/plat-linux2/gimodule.cpython-32mu.so
# trying /usr/lib/python3.2/plat-linux2/gi.abi3.so
# trying /usr/lib/python3.2/plat-linux2/gimodule.abi3.so
# trying /usr/lib/python3.2/plat-linux2/gi.so
# trying /usr/lib/python3.2/plat-linux2/gimodule.so
# trying /usr/lib/python3.2/plat-linux2/gi.py
# trying /usr/lib/python3.2/plat-linux2/gi.pyc
# trying /usr/lib/python3.2/lib-dynload/gi.cpython-32mu.so
# trying /usr/lib/python3.2/lib-dynload/gimodule.cpython-32mu.so
# trying /usr/lib/python3.2/lib-dynload/gi.abi3.so
# trying /usr/lib/python3.2/lib-dynload/gimodule.abi3.so
# trying /usr/lib/python3.2/lib-dynload/gi.so
# trying /usr/lib/python3.2/lib-dynload/gimodule.so
# try /usr/lib/python3.2/lib-dynload/gi.py
# trying /usr/lib/python3.2/lib-dynload/gi.pyc
# trying /usr/local/lib/python3.2/dist-packages/gi.cpython-32mu.so
# trying /usr/local/lib/python3.2/dist-packages/gimodule.cpython-32mu.so
# trying /usr/local/lib/python3.2/dist-packages/gi.abi3.so
# trying /usr/local/lib/python3.2/dist-packages/gimodule.abi3.so
# trying /usr/local/lib/python3.2/dist-packages/gi.so
# trying /usr/local/lib/python3.2/dist-packages/gimodule.so
# trying /usr/local/lib/python3.2/dist-packages/gi.py
# trying /usr/local/lib/python3.2/dist-packages/gi.pyc
# trying /usr/lib/python3/dist-packages/gi.cpython-32mu.so
# trying /usr/lib/python3/dist-packages/gimodule.cpython-32mu.so
# trying /usr/lib/python3/dist-packages/gi.abi3.so
# trying /usr/lib/python3/dist-packages/gimodule.abi3.so
# trying /usr/lib/python3/dist-packages/gi.so
# trying /usr/lib/python3/dist-packages/gimodule.so
# trying /usr/lib/python3/dist-packages/gi.py
# trying /usr/lib/python3/dist-packages/gi.pyc
Rückverfolgung (letzter Anruf zuletzt):
Datei "", Zeile 1, in
ImportError: Kein Modul namens gi
Der Suchpfad betrachtet nicht einmal den python2.7-Pfad. So sieht es von der erfolgreichen Seite von python2.7 aus.
>>> gi importieren
# versuchen, gi.so
# try gimodule.so
# versuchen, gi.py
# versuchen, gi.pyc
# trying /usr/lib/python2.7/gi.so
# trying /usr/lib/python2.7/gimodule.so
# try /usr/lib/python2.7/gi.py
# try /usr/lib/python2.7/gi.pyc
# trying /usr/lib/python2.7/plat-linux2/gi.so
# trying /usr/lib/python2.7/plat-linux2/gimodule.so
# trying /usr/lib/python2.7/plat-linux2/gi.py
# trying /usr/lib/python2.7/plat-linux2/gi.pyc
# trying /usr/lib/python2.7/lib-tk/gi.so
# trying /usr/lib/python2.7/lib-tk/gimodule.so
# trying /usr/lib/python2.7/lib-tk/gi.py
# trying /usr/lib/python2.7/lib-tk/gi.pyc
# trying /usr/lib/python2.7/lib-dynload/gi.so
# trying /usr/lib/python2.7/lib-dynload/gimodule.so
# trying /usr/lib/python2.7/lib-dynload/gi.py
# trying /usr/lib/python2.7/lib-dynload/gi.pyc
# trying /usr/local/lib/python2.7/dist-packages/gi.so
# trying /usr/local/lib/python2.7/dist-packages/gimodule.so
# trying /usr/local/lib/python2.7/dist-packages/gi.py
# trying /usr/local/lib/python2.7/dist-packages/gi.pyc
Importieren Sie das GI-Verzeichnis /usr/lib/python2.7/dist-packages/gi
# trying /usr/lib/python2.7/dist-packages/gi/__init__.so
# trying /usr/lib/python2.7/dist-packages/gi/__init__module.so
# trying /usr/lib/python2.7/dist-packages/gi/__init__.py
# /usr/lib/python2.7/dist-packages/gi/__init__.pyc stimmt mit /usr/lib/python2.7/dist-packages/gi/__init__.py überein
Importieren Sie gi # aus /usr/lib/python2.7/dist-packages/gi/__init__.pyc vorkompiliert
# try __future__.so
# try __future__module.so
# try __future__.py
# try __future __. pyc
# trying /usr/lib/python2.7/__future__.so
# trying /usr/lib/python2.7/__future__module.so
# trying /usr/lib/python2.7/__future__.py
# /usr/lib/python2.7/__future__.pyc stimmt mit /usr/lib/python2.7/__future__.py überein
import __future__ # Vorkompiliert aus /usr/lib/python2.7/__future__.pyc
# trying /usr/lib/python2.7/dist-packages/gi/_gi.so
dlopen ("/ usr / lib / python2.7 / dist-packages / gi / _gi.so", 2);
Importieren Sie das gi._gobject-Verzeichnis /usr/lib/python2.7/dist-packages/gi/_gobject
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/__init__module.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.py
# /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.pyc stimmt mit /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.py überein
Importieren Sie gi._gobject # aus /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.pyc vorkompiliert
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/sys.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/sysmodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/sys.py
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/sys.pyc
Importieren Sie das gi._glib # -Verzeichnis /usr/lib/python2.7/dist-packages/gi/_glib
# trying /usr/lib/python2.7/dist-packages/gi/_glib/__init__.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/__init__module.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/__init__.py
# /usr/lib/python2.7/dist-packages/gi/_glib/__init__.pyc stimmt mit /usr/lib/python2.7/dist-packages/gi/_glib/__init__.py überein
import gi._glib # aus /usr/lib/python2.7/dist-packages/gi/_glib/__init__.pyc vorkompiliert
# trying /usr/lib/python2.7/dist-packages/gi/_glib/_glib.so
dlopen ("/ usr / lib / python2.7 / dist-packages / gi / _glib / _glib.so", 2);
import gi._glib._glib # wird dynamisch aus /usr/lib/python2.7/dist-packages/gi/_glib/_glib.so geladen
# trying /usr/lib/python2.7/dist-packages/gi/_glib/option.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/optionmodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/option.py
# /usr/lib/python2.7/dist-packages/gi/_glib/option.pyc stimmt mit /usr/lib/python2.7/dist-packages/gi/_glib/option.py überein
Importieren Sie gi._glib.option # aus /usr/lib/python2.7/dist-packages/gi/_glib/option.pyc vorkompiliert
# trying /usr/lib/python2.7/dist-packages/gi/_glib/sys.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/sysmodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/sys.py
# trying /usr/lib/python2.7/dist-packages/gi/_glib/sys.pyc
# trying /usr/lib/python2.7/dist-packages/gi/_glib/optparse.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/optparsemodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/optparse.py
# trying /usr/lib/python2.7/dist-packages/gi/_glib/optparse.pyc
# versuchen, optparse.so
# versuchen optparsemodule.so
# versuchen, optparse.py
# versuchen optparse.pyc
# trying /usr/lib/python2.7/optparse.so
# trying /usr/lib/python2.7/optparsemodule.so
# trying /usr/lib/python2.7/optparse.py
# /usr/lib/python2.7/optparse.pyc stimmt mit /usr/lib/python2.7/optparse.py überein
importiere optparse # vorkompiliert aus /usr/lib/python2.7/optparse.pyc
# versuchen textwrap.so
# versuchen textwrapmodule.so
# versuchen textwrap.py
# versuchen textwrap.pyc
# trying /usr/lib/python2.7/textwrap.so
# trying /usr/lib/python2.7/textwrapmodule.so
# trying /usr/lib/python2.7/textwrap.py
# /usr/lib/python2.7/textwrap.pyc stimmt mit /usr/lib/python2.7/textwrap.py überein
Importieren Sie den vorkompilierten Textwrap # aus /usr/lib/python2.7/textwrap.pyc
# String.so versuchen
# versucht stringmodule.so
# versucht string.py
# versucht string.pyc
# trying /usr/lib/python2.7/string.so
# trying /usr/lib/python2.7/stringmodule.so
# try /usr/lib/python2.7/string.py
# /usr/lib/python2.7/string.pyc stimmt mit /usr/lib/python2.7/string.py überein
Importieren Sie die Zeichenfolge #, die aus /usr/lib/python2.7/string.pyc vorkompiliert wurde
Import Strop # Builtin
# versuchen gettext.so
# try gettextmodule.so
# versuchen gettext.py
# versuchen gettext.pyc
# trying /usr/lib/python2.7/gettext.so
# trying /usr/lib/python2.7/gettextmodule.so
# trying /usr/lib/python2.7/gettext.py
# /usr/lib/python2.7/gettext.pyc stimmt mit /usr/lib/python2.7/gettext.py überein
Importieren Sie gettext # aus /usr/lib/python2.7/gettext.pyc vorkompiliert
# versuchen locale.so
# versuchen localemodule.so
# versuchen locale.py
# versuchen locale.pyc
# trying /usr/lib/python2.7/locale.so
# trying /usr/lib/python2.7/localemodule.so
# trying /usr/lib/python2.7/locale.py
# /usr/lib/python2.7/locale.pyc stimmt mit /usr/lib/python2.7/locale.py überein
Importgebietsschema # vorkompiliert aus /usr/lib/python2.7/locale.pyc
Importoperator # eingebaut
# versuchen functools.so
# versuchen functoolsmodule.so
# versuchen functools.py
# versuchen functools.pyc
# try /usr/lib/python2.7/functools.so
# trying /usr/lib/python2.7/functoolsmodule.so
# try /usr/lib/python2.7/functools.py
# /usr/lib/python2.7/functools.pyc stimmt mit /usr/lib/python2.7/functools.py überein
import functools # aus /usr/lib/python2.7/functools.pyc vorkompiliert
import _functools # builtin
_locale # builtin importieren
# copy.so versuchen
# versuchen, copymodule.so
# copy.py versuchen
# copy.pyc versuchen
# trying /usr/lib/python2.7/copy.so
# trying /usr/lib/python2.7/copymodule.so
# trying /usr/lib/python2.7/copy.py
# /usr/lib/python2.7/copy.pyc stimmt mit /usr/lib/python2.7/copy.py überein
Importkopie # aus /usr/lib/python2.7/copy.pyc vorkompiliert
# Schwach ref.so versuchen
# weakrefmodule.so versuchen
versuchen # weakref.py
# Es versucht weakref.pyc
# trying /usr/lib/python2.7/weakref.so
# trying /usr/lib/python2.7/weakrefmodule.so
# trying /usr/lib/python2.7/weakref.py
# /usr/lib/python2.7/weakref.pyc stimmt mit /usr/lib/python2.7/weakref.py überein
import schwachref # vorkompiliert aus /usr/lib/python2.7/weakref.pyc
# versuchen org.so
# versuchen orgmodule.so
# try org.py
# try org.pyc
# trying /usr/lib/python2.7/org.so
# trying /usr/lib/python2.7/orgmodule.so
# trying /usr/lib/python2.7/org.py
# try /usr/lib/python2.7/org.pyc
# trying /usr/lib/python2.7/plat-linux2/org.so
# trying /usr/lib/python2.7/plat-linux2/orgmodule.so
# trying /usr/lib/python2.7/plat-linux2/org.py
# trying /usr/lib/python2.7/plat-linux2/org.pyc
# trying /usr/lib/python2.7/lib-tk/org.so
# trying /usr/lib/python2.7/lib-tk/orgmodule.so
# trying /usr/lib/python2.7/lib-tk/org.py
# trying /usr/lib/python2.7/lib-tk/org.pyc
# trying /usr/lib/python2.7/lib-dynload/org.so
# trying /usr/lib/python2.7/lib-dynload/orgmodule.so
# trying /usr/lib/python2.7/lib-dynload/org.py
# trying /usr/lib/python2.7/lib-dynload/org.pyc
# trying /usr/local/lib/python2.7/dist-packages/org.so
# trying /usr/local/lib/python2.7/dist-packages/orgmodule.so
# trying /usr/local/lib/python2.7/dist-packages/org.py
# trying /usr/local/lib/python2.7/dist-packages/org.pyc
# trying /usr/lib/python2.7/dist-packages/org.so
# trying /usr/lib/python2.7/dist-packages/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/org.py
# trying /usr/lib/python2.7/dist-packages/org.pyc
# trying /usr/lib/python2.7/dist-packages/PIL/org.so
# trying /usr/lib/python2.7/dist-packages/PIL/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/PIL/org.py
# trying /usr/lib/python2.7/dist-packages/PIL/org.pyc
# trying /usr/lib/python2.7/dist-packages/gst-0.10/org.so
# trying /usr/lib/python2.7/dist-packages/gst-0.10/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/gst-0.10/org.py
# trying /usr/lib/python2.7/dist-packages/gst-0.10/org.pyc
# trying /usr/lib/python2.7/dist-packages/gtk-2.0/org.so
# trying /usr/lib/python2.7/dist-packages/gtk-2.0/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/gtk-2.0/org.py
# trying /usr/lib/python2.7/dist-packages/gtk-2.0/org.pyc
# trying /usr/lib/pymodules/python2.7/org.so
# trying /usr/lib/pymodules/python2.7/orgmodule.so
# trying /usr/lib/pymodules/python2.7/org.py
# trying /usr/lib/pymodules/python2.7/org.pyc
# trying /usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.so
# trying /usr/lib/python2.7/dist-packages/ubuntu-sso-client/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.py
# trying /usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.pyc
# trying /usr/lib/python2.7/dist-packages/ubuntuone-client/org.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-client/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-client/org.py
# trying /usr/lib/python2.7/dist-packages/ubuntuone-client/org.pyc
# trying /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.py
# trying /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.pyc
# trying /usr/lib/python2.7/dist-packages/ubuntuone-couch/org.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-couch/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-couch/org.py
# trying /usr/lib/python2.7/dist-packages/ubuntuone-couch/org.pyc
# trying /usr/lib/python2.7/dist-packages/ubuntuone-installer/org.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-installer/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-installer/org.py
# trying /usr/lib/python2.7/dist-packages/ubuntuone-installer/org.pyc
# trying /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/orgmodule.so
# trying /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.py
# trying /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.pyc
# try struct.so
# structmodule.so versuchen
# try struct.py
# try struct.pyc
# trying /usr/lib/python2.7/struct.so
# trying /usr/lib/python2.7/structmodule.so
# trying /usr/lib/python2.7/struct.py
# /usr/lib/python2.7/struct.pyc stimmt mit /usr/lib/python2.7/struct.py überein
Importstruktur # aus /usr/lib/python2.7/struct.pyc vorkompiliert
_struct # builtin importieren
# trying /usr/lib/python2.7/dist-packages/gi/_glib/gi.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/gimodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_glib/gi.py
# trying /usr/lib/python2.7/dist-packages/gi/_glib/gi.pyc
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/constants.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/constantsmodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/constants.py
# /usr/lib/python2.7/dist-packages/gi/_gobject/constants.pyc entspricht /usr/lib/python2.7/dist-packages/gi/_gobject/constants.py
importieren Sie gi._gobject.constants # aus /usr/lib/python2.7/dist-packages/gi/_gobject/constants.pyc vorkompiliert
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so
dlopen ("/ usr / lib / python2.7 / dist-packages / gi / _gobject / _gobject.so", 2);
Importieren Sie gi._gobject._gobject #, das dynamisch aus /usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so geladen wurde
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelpermodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.py
# /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.pyc entspricht /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.py
Importieren Sie gi._gobject.propertyhelper # aus /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.pyc vorkompiliert
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrappermodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.py
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.pyc
# versuchen datetime.so
# versuchen datetimemodule.so
# versuchen datetime.py
# versuchen datetime.pyc
# try /usr/lib/python2.7/datetime.so
# trying /usr/lib/python2.7/datetimemodule.so
# try /usr/lib/python2.7/datetime.py
# try /usr/lib/python2.7/datetime.pyc
# trying /usr/lib/python2.7/plat-linux2/datetime.so
# trying /usr/lib/python2.7/plat-linux2/datetimemodule.so
# trying /usr/lib/python2.7/plat-linux2/datetime.py
# trying /usr/lib/python2.7/plat-linux2/datetime.pyc
# trying /usr/lib/python2.7/lib-tk/datetime.so
# trying /usr/lib/python2.7/lib-tk/datetimemodule.so
# trying /usr/lib/python2.7/lib-tk/datetime.py
# trying /usr/lib/python2.7/lib-tk/datetime.pyc
# trying /usr/lib/python2.7/lib-dynload/datetime.so
dlopen ("/usr/lib/python2.7/lib-dynload/datetime.so", 2);
import datetime # wird dynamisch aus /usr/lib/python2.7/lib-dynload/datetime.so geladen
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrappermodule.so
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.py
# trying /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.pyc
import gi._gi # wird dynamisch aus /usr/lib/python2.7/dist-packages/gi/_gi.so geladen