Aumentare la verbosità dell'interprete aiuta molto a risolvere questo problema. Anche dopo tutto ciò, ho provato a fare un semplice link simbolico del pacchetto dist di 2.7 al mio pacchetto dist di 3.x usr / local e sono andato un po 'oltre, ma non molto.
sudo ln -s /usr/lib/python2.7/dist-packages/gi/ /usr/local/lib/python3.2/dist-packages
~ $ python3
Python 3.2.2+ (impostazione predefinita, 16 febbraio 2012, 19:05:44)
[GCC 4.6.2] su linux2
Digita "aiuto", "copyright", "crediti" o "licenza" per ulteriori informazioni.
>>> import gi
Traceback (ultima chiamata più recente):
File "", riga 1, in
File "/usr/local/lib/python3.2/dist-packages/gi/__init__.py", riga 23, in
da ._gi import _API, Repository
ImportError: /usr/lib/libpyglib-gi-2.0-python2.7.so.0: simbolo non definito: _Py_ZeroStruct
Se riesci a rintracciare quel simbolo mancante potresti essere in grado di risolvere questo problema. Ecco tutto l'output di importazione dettagliato che mi ha portato così lontano. Inoltre, questo sembra rilevante: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=645963 , buona fortuna.
>>> import gi
# provando gi.cpython-32mu.so
# provando gimodule.cpython-32mu.so
# provando gi.abi3.so
# provando gimodule.abi3.so
# provando gi.so
# provando gimodule.so
# provando gi.py
# provando gi.pyc
# try /usr/lib/python3.2/gi.cpython-32mu.so
# try /usr/lib/python3.2/gimodule.cpython-32mu.so
# try /usr/lib/python3.2/gi.abi3.so
# try /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
# try /usr/lib/python3.2/plat-linux2/gi.cpython-32mu.so
# try /usr/lib/python3.2/plat-linux2/gimodule.cpython-32mu.so
# try /usr/lib/python3.2/plat-linux2/gi.abi3.so
# try /usr/lib/python3.2/plat-linux2/gimodule.abi3.so
# try /usr/lib/python3.2/plat-linux2/gi.so
# try /usr/lib/python3.2/plat-linux2/gimodule.so
# try /usr/lib/python3.2/plat-linux2/gi.py
# try /usr/lib/python3.2/plat-linux2/gi.pyc
# try /usr/lib/python3.2/lib-dynload/gi.cpython-32mu.so
# try /usr/lib/python3.2/lib-dynload/gimodule.cpython-32mu.so
# try /usr/lib/python3.2/lib-dynload/gi.abi3.so
# try /usr/lib/python3.2/lib-dynload/gimodule.abi3.so
# try /usr/lib/python3.2/lib-dynload/gi.so
# try /usr/lib/python3.2/lib-dynload/gimodule.so
# try /usr/lib/python3.2/lib-dynload/gi.py
# try /usr/lib/python3.2/lib-dynload/gi.pyc
# try /usr/local/lib/python3.2/dist-packages/gi.cpython-32mu.so
# try /usr/local/lib/python3.2/dist-packages/gimodule.cpython-32mu.so
# try /usr/local/lib/python3.2/dist-packages/gi.abi3.so
# try /usr/local/lib/python3.2/dist-packages/gimodule.abi3.so
# try /usr/local/lib/python3.2/dist-packages/gi.so
# try /usr/local/lib/python3.2/dist-packages/gimodule.so
# try /usr/local/lib/python3.2/dist-packages/gi.py
# try /usr/local/lib/python3.2/dist-packages/gi.pyc
# try /usr/lib/python3/dist-packages/gi.cpython-32mu.so
# try /usr/lib/python3/dist-packages/gimodule.cpython-32mu.so
# try /usr/lib/python3/dist-packages/gi.abi3.so
# try /usr/lib/python3/dist-packages/gimodule.abi3.so
# try /usr/lib/python3/dist-packages/gi.so
# try /usr/lib/python3/dist-packages/gimodule.so
# try /usr/lib/python3/dist-packages/gi.py
# try /usr/lib/python3/dist-packages/gi.pyc
Traceback (ultima chiamata più recente):
File "", riga 1, in
ImportError: nessun modulo chiamato gi
Il percorso di ricerca non osserva nemmeno il percorso python2.7. Ecco come appare dal lato positivo di python2.7.
>>> import gi
# provando gi.so
# provando gimodule.so
# provando gi.py
# provando gi.pyc
# try /usr/lib/python2.7/gi.so
# try /usr/lib/python2.7/gimodule.so
# try /usr/lib/python2.7/gi.py
# try /usr/lib/python2.7/gi.pyc
# try /usr/lib/python2.7/plat-linux2/gi.so
# try /usr/lib/python2.7/plat-linux2/gimodule.so
# try /usr/lib/python2.7/plat-linux2/gi.py
# try /usr/lib/python2.7/plat-linux2/gi.pyc
# try /usr/lib/python2.7/lib-tk/gi.so
# try /usr/lib/python2.7/lib-tk/gimodule.so
# try /usr/lib/python2.7/lib-tk/gi.py
# try /usr/lib/python2.7/lib-tk/gi.pyc
# try /usr/lib/python2.7/lib-dynload/gi.so
# try /usr/lib/python2.7/lib-dynload/gimodule.so
# try /usr/lib/python2.7/lib-dynload/gi.py
# try /usr/lib/python2.7/lib-dynload/gi.pyc
# try /usr/local/lib/python2.7/dist-packages/gi.so
# try /usr/local/lib/python2.7/dist-packages/gimodule.so
# try /usr/local/lib/python2.7/dist-packages/gi.py
# try /usr/local/lib/python2.7/dist-packages/gi.pyc
import gi # directory /usr/lib/python2.7/dist-packages/gi
# try /usr/lib/python2.7/dist-packages/gi/__init__.so
# try /usr/lib/python2.7/dist-packages/gi/__init__module.so
# try /usr/lib/python2.7/dist-packages/gi/__init__.py
# /usr/lib/python2.7/dist-packages/gi/__init__.pyc match /usr/lib/python2.7/dist-packages/gi/__init__.py
import gi # precompilato da /usr/lib/python2.7/dist-packages/gi/__init__.pyc
# try __future__.so
# try __future__module.so
# try __future__.py
# try __future __. pyc
# try /usr/lib/python2.7/__future__.so
# try /usr/lib/python2.7/__future__module.so
# try /usr/lib/python2.7/__future__.py
# /usr/lib/python2.7/__future__.pyc corrisponde a /usr/lib/python2.7/__future__.py
import __future__ # precompilato da /usr/lib/python2.7/__future__.pyc
# try /usr/lib/python2.7/dist-packages/gi/_gi.so
dlopen ("/ usr / lib / python2.7 / dist-pacchetti / gi / _gi.so", 2);
import gi._gobject # directory /usr/lib/python2.7/dist-packages/gi/_gobject
# try /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/__init__module.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.py
# /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.pyc match /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.py
import gi._gobject # precompilato da /usr/lib/python2.7/dist-packages/gi/_gobject/__init__.pyc
# try /usr/lib/python2.7/dist-packages/gi/_gobject/sys.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/sysmodule.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/sys.py
# try /usr/lib/python2.7/dist-packages/gi/_gobject/sys.pyc
import gi._glib # directory /usr/lib/python2.7/dist-packages/gi/_glib
# try /usr/lib/python2.7/dist-packages/gi/_glib/__init__.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/__init__module.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/__init__.py
# /usr/lib/python2.7/dist-packages/gi/_glib/__init__.pyc match /usr/lib/python2.7/dist-packages/gi/_glib/__init__.py
import gi._glib # precompilato da /usr/lib/python2.7/dist-packages/gi/_glib/__init__.pyc
# try /usr/lib/python2.7/dist-packages/gi/_glib/_glib.so
dlopen ("/ usr / lib / python2.7 / dist-pacchetti / gi / _glib / _glib.so", 2);
import gi._glib._glib # caricato dinamicamente da /usr/lib/python2.7/dist-packages/gi/_glib/_glib.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/option.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/optionmodule.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/option.py
# /usr/lib/python2.7/dist-packages/gi/_glib/option.pyc match /usr/lib/python2.7/dist-packages/gi/_glib/option.py
import gi._glib.option # precompilato da /usr/lib/python2.7/dist-packages/gi/_glib/option.pyc
# try /usr/lib/python2.7/dist-packages/gi/_glib/sys.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/sysmodule.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/sys.py
# try /usr/lib/python2.7/dist-packages/gi/_glib/sys.pyc
# try /usr/lib/python2.7/dist-packages/gi/_glib/optparse.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/optparsemodule.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/optparse.py
# try /usr/lib/python2.7/dist-packages/gi/_glib/optparse.pyc
# try optparse.so
# try optparsemodule.so
# try optparse.py
# try optparse.pyc
# try /usr/lib/python2.7/optparse.so
# try /usr/lib/python2.7/optparsemodule.so
# try /usr/lib/python2.7/optparse.py
# /usr/lib/python2.7/optparse.pyc corrisponde a /usr/lib/python2.7/optparse.py
import optparse # precompilato da /usr/lib/python2.7/optparse.pyc
# provando textwrap.so
# try textwrapmodule.so
# try textwrap.py
# try textwrap.pyc
# try /usr/lib/python2.7/textwrap.so
# try /usr/lib/python2.7/textwrapmodule.so
# try /usr/lib/python2.7/textwrap.py
# /usr/lib/python2.7/textwrap.pyc corrisponde a /usr/lib/python2.7/textwrap.py
import textwrap # precompilato da /usr/lib/python2.7/textwrap.pyc
# try string.so
# try stringmodule.so
# try string.py
# try string.pyc
# try /usr/lib/python2.7/string.so
# try /usr/lib/python2.7/stringmodule.so
# try /usr/lib/python2.7/string.py
# /usr/lib/python2.7/string.pyc match /usr/lib/python2.7/string.py
stringa di importazione # precompilata da /usr/lib/python2.7/string.pyc
import strop # builtin
# cercando gettext.so
# cercando gettextmodule.so
# cercando gettext.py
# cercando gettext.pyc
# try /usr/lib/python2.7/gettext.so
# try /usr/lib/python2.7/gettextmodule.so
# try /usr/lib/python2.7/gettext.py
# /usr/lib/python2.7/gettext.pyc corrisponde a /usr/lib/python2.7/gettext.py
import gettext # precompilato da /usr/lib/python2.7/gettext.pyc
# provare locale.so
# provare localemodule.so
# provare locale.py
# provare locale.pyc
# try /usr/lib/python2.7/locale.so
# try /usr/lib/python2.7/localemodule.so
# try /usr/lib/python2.7/locale.py
# /usr/lib/python2.7/locale.pyc corrisponde a /usr/lib/python2.7/locale.py
import locale # precompilato da /usr/lib/python2.7/locale.pyc
operatore di importazione # incorporato
# try functools.so
# try functoolsmodule.so
# try functools.py
# try functools.pyc
# try /usr/lib/python2.7/functools.so
# try /usr/lib/python2.7/functoolsmodule.so
# try /usr/lib/python2.7/functools.py
# /usr/lib/python2.7/functools.pyc corrisponde a /usr/lib/python2.7/functools.py
import functools # precompilato da /usr/lib/python2.7/functools.pyc
import _functools # builtin
import _locale # builtin
# try copy.so
# cercando copymodule.so
# try copy.py
# try copy.pyc
# try /usr/lib/python2.7/copy.so
# try /usr/lib/python2.7/copymodule.so
# try /usr/lib/python2.7/copy.py
# /usr/lib/python2.7/copy.pyc corrisponde a /usr/lib/python2.7/copy.py
import copy # precompilato da /usr/lib/python2.7/copy.pyc
# try weakref.so
# prova a weakrefmodule.so
# prova a weakref.py
# provare a weakref.pyc
# try /usr/lib/python2.7/weakref.so
# try /usr/lib/python2.7/weakrefmodule.so
# try /usr/lib/python2.7/weakref.py
# /usr/lib/python2.7/weakref.pyc corrisponde a /usr/lib/python2.7/weakref.py
import weakref # precompilato da /usr/lib/python2.7/weakref.pyc
# provando org.so
# provando orgmodule.so
# provando org.py
# provando org.pyc
# try /usr/lib/python2.7/org.so
# try /usr/lib/python2.7/orgmodule.so
# try /usr/lib/python2.7/org.py
# try /usr/lib/python2.7/org.pyc
# try /usr/lib/python2.7/plat-linux2/org.so
# try /usr/lib/python2.7/plat-linux2/orgmodule.so
# try /usr/lib/python2.7/plat-linux2/org.py
# try /usr/lib/python2.7/plat-linux2/org.pyc
# try /usr/lib/python2.7/lib-tk/org.so
# try /usr/lib/python2.7/lib-tk/orgmodule.so
# try /usr/lib/python2.7/lib-tk/org.py
# try /usr/lib/python2.7/lib-tk/org.pyc
# try /usr/lib/python2.7/lib-dynload/org.so
# try /usr/lib/python2.7/lib-dynload/orgmodule.so
# try /usr/lib/python2.7/lib-dynload/org.py
# try /usr/lib/python2.7/lib-dynload/org.pyc
# try /usr/local/lib/python2.7/dist-packages/org.so
# try /usr/local/lib/python2.7/dist-packages/orgmodule.so
# try /usr/local/lib/python2.7/dist-packages/org.py
# try /usr/local/lib/python2.7/dist-packages/org.pyc
# try /usr/lib/python2.7/dist-packages/org.so
# try /usr/lib/python2.7/dist-packages/orgmodule.so
# try /usr/lib/python2.7/dist-packages/org.py
# try /usr/lib/python2.7/dist-packages/org.pyc
# try /usr/lib/python2.7/dist-packages/PIL/org.so
# try /usr/lib/python2.7/dist-packages/PIL/orgmodule.so
# try /usr/lib/python2.7/dist-packages/PIL/org.py
# try /usr/lib/python2.7/dist-packages/PIL/org.pyc
# try /usr/lib/python2.7/dist-packages/gst-0.10/org.so
# try /usr/lib/python2.7/dist-packages/gst-0.10/orgmodule.so
# try /usr/lib/python2.7/dist-packages/gst-0.10/org.py
# try /usr/lib/python2.7/dist-packages/gst-0.10/org.pyc
# try /usr/lib/python2.7/dist-packages/gtk-2.0/org.so
# try /usr/lib/python2.7/dist-packages/gtk-2.0/orgmodule.so
# try /usr/lib/python2.7/dist-packages/gtk-2.0/org.py
# try /usr/lib/python2.7/dist-packages/gtk-2.0/org.pyc
# try /usr/lib/pymodules/python2.7/org.so
# try /usr/lib/pymodules/python2.7/orgmodule.so
# try /usr/lib/pymodules/python2.7/org.py
# try /usr/lib/pymodules/python2.7/org.pyc
# try /usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.so
# try /usr/lib/python2.7/dist-packages/ubuntu-sso-client/orgmodule.so
# try /usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.py
# try /usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.pyc
# try /usr/lib/python2.7/dist-packages/ubuntuone-client/org.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-client/orgmodule.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-client/org.py
# try /usr/lib/python2.7/dist-packages/ubuntuone-client/org.pyc
# try /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/orgmodule.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.py
# try /usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.pyc
# try /usr/lib/python2.7/dist-packages/ubuntuone-couch/org.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-couch/orgmodule.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-couch/org.py
# try /usr/lib/python2.7/dist-packages/ubuntuone-couch/org.pyc
# try /usr/lib/python2.7/dist-packages/ubuntuone-installer/org.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-installer/orgmodule.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-installer/org.py
# try /usr/lib/python2.7/dist-packages/ubuntuone-installer/org.pyc
# try /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/orgmodule.so
# try /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.py
# try /usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.pyc
# cercando struct.so
# provando structmodule.so
# cercando struct.py
# try struct.pyc
# try /usr/lib/python2.7/struct.so
# try /usr/lib/python2.7/structmodule.so
# try /usr/lib/python2.7/struct.py
# /usr/lib/python2.7/struct.pyc corrisponde a /usr/lib/python2.7/struct.py
import struct # precompilato da /usr/lib/python2.7/struct.pyc
import _struct # builtin
# try /usr/lib/python2.7/dist-packages/gi/_glib/gi.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/gimodule.so
# try /usr/lib/python2.7/dist-packages/gi/_glib/gi.py
# try /usr/lib/python2.7/dist-packages/gi/_glib/gi.pyc
# try /usr/lib/python2.7/dist-packages/gi/_gobject/constants.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/constantsmodule.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/constants.py
# /usr/lib/python2.7/dist-packages/gi/_gobject/constants.pyc match /usr/lib/python2.7/dist-packages/gi/_gobject/constants.py
import gi._gobject.constants # precompilato da /usr/lib/python2.7/dist-packages/gi/_gobject/constants.pyc
# try /usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so
dlopen ("/ usr / lib / python2.7 / dist-pacchetti / gi / _gobject / _gobject.so", 2);
import gi._gobject._gobject # caricato dinamicamente da /usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelpermodule.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.py
# /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.pyc match /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.py
import gi._gobject.propertyhelper # precompilato da /usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.pyc
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrappermodule.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.py
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.pyc
# try datetime.so
# try datetimemodule.so
# try datetime.py
# try datetime.pyc
# try /usr/lib/python2.7/datetime.so
# try /usr/lib/python2.7/datetimemodule.so
# try /usr/lib/python2.7/datetime.py
# try /usr/lib/python2.7/datetime.pyc
# try /usr/lib/python2.7/plat-linux2/datetime.so
# try /usr/lib/python2.7/plat-linux2/datetimemodule.so
# try /usr/lib/python2.7/plat-linux2/datetime.py
# try /usr/lib/python2.7/plat-linux2/datetime.pyc
# try /usr/lib/python2.7/lib-tk/datetime.so
# try /usr/lib/python2.7/lib-tk/datetimemodule.so
# try /usr/lib/python2.7/lib-tk/datetime.py
# try /usr/lib/python2.7/lib-tk/datetime.pyc
# try /usr/lib/python2.7/lib-dynload/datetime.so
dlopen ("/ usr / lib / python2.7 / lib-dynload / datetime.so", 2);
import datetime # caricato dinamicamente da /usr/lib/python2.7/lib-dynload/datetime.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrappermodule.so
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.py
# try /usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.pyc
import gi._gi # caricato dinamicamente da /usr/lib/python2.7/dist-packages/gi/_gi.so