提高解释程序的冗长性有助于解决这个问题。即便如此,我还是尝试了将2.7 dist包与我的usr / local 3.x dist包进行简单的符号链接,并做了一些进一步的工作,但幅度不大。
sudo ln -s /usr/lib/python2.7/dist-packages/gi/ /usr/local/lib/python3.2/dist-packages
〜$ python3
Python 3.2.2+(默认值,2012年2月16日,19:05:44)
linux2上的[GCC 4.6.2]
键入“帮助”,“版权”,“信用”或“许可证”以获取更多信息。
>>>导入gi
追溯(最近一次通话):
文件“”,第1行,位于
在第23行的“ /usr/local/lib/python3.2/dist-packages/gi/__init__.py”文件中
从._gi导入_API,存储库
ImportError:/usr/lib/libpyglib-gi-2.0-python2.7.so.0:未定义的符号:_Py_ZeroStruct
如果您可以找到该丢失的符号,则可以解决此问题。这是导致我到目前为止的所有冗长的导入输出。另外,这似乎很相关:http : //bugs.debian.org/cgi-bin/bugreport.cgi?bug=645963,祝您好运。
>>>导入gi
#尝试gi.cpython-32mu.so
#尝试gimodule.cpython-32mu.so
#尝试gi.abi3.so
#尝试gimodule.abi3.so
#尝试gi.so
#尝试gimodule.so
#尝试gi.py
#尝试gi.pyc
#尝试/usr/lib/python3.2/gi.cpython-32mu.so
#尝试/usr/lib/python3.2/gimodule.cpython-32mu.so
#尝试/usr/lib/python3.2/gi.abi3.so
#尝试/usr/lib/python3.2/gimodule.abi3.so
#尝试/usr/lib/python3.2/gi.so
#尝试/usr/lib/python3.2/gimodule.so
#尝试/usr/lib/python3.2/gi.py
#尝试/usr/lib/python3.2/gi.pyc
#尝试/usr/lib/python3.2/plat-linux2/gi.cpython-32mu.so
#尝试/usr/lib/python3.2/plat-linux2/gimodule.cpython-32mu.so
#尝试/usr/lib/python3.2/plat-linux2/gi.abi3.so
#尝试/usr/lib/python3.2/plat-linux2/gimodule.abi3.so
#尝试/usr/lib/python3.2/plat-linux2/gi.so
#尝试/usr/lib/python3.2/plat-linux2/gimodule.so
#尝试/usr/lib/python3.2/plat-linux2/gi.py
#尝试/usr/lib/python3.2/plat-linux2/gi.pyc
#尝试/usr/lib/python3.2/lib-dynload/gi.cpython-32mu.so
#尝试/usr/lib/python3.2/lib-dynload/gimodule.cpython-32mu.so
#尝试/usr/lib/python3.2/lib-dynload/gi.abi3.so
#尝试/usr/lib/python3.2/lib-dynload/gimodule.abi3.so
#尝试/usr/lib/python3.2/lib-dynload/gi.so
#尝试/usr/lib/python3.2/lib-dynload/gimodule.so
#尝试/usr/lib/python3.2/lib-dynload/gi.py
#尝试/usr/lib/python3.2/lib-dynload/gi.pyc
#尝试/usr/local/lib/python3.2/dist-packages/gi.cpython-32mu.so
#尝试/usr/local/lib/python3.2/dist-packages/gimodule.cpython-32mu.so
#尝试/usr/local/lib/python3.2/dist-packages/gi.abi3.so
#尝试/usr/local/lib/python3.2/dist-packages/gimodule.abi3.so
#尝试/usr/local/lib/python3.2/dist-packages/gi.so
#尝试/usr/local/lib/python3.2/dist-packages/gimodule.so
#尝试/usr/local/lib/python3.2/dist-packages/gi.py
#尝试/usr/local/lib/python3.2/dist-packages/gi.pyc
#尝试/usr/lib/python3/dist-packages/gi.cpython-32mu.so
#尝试/usr/lib/python3/dist-packages/gimodule.cpython-32mu.so
#尝试/usr/lib/python3/dist-packages/gi.abi3.so
#尝试/usr/lib/python3/dist-packages/gimodule.abi3.so
#尝试/usr/lib/python3/dist-packages/gi.so
#尝试/usr/lib/python3/dist-packages/gimodule.so
#尝试/usr/lib/python3/dist-packages/gi.py
#尝试/usr/lib/python3/dist-packages/gi.pyc
追溯(最近一次通话):
文件“”,第1行,位于
ImportError:没有名为gi的模块
搜索路径甚至没有查看python2.7路径。这是从python2.7成功的一面来看的样子。
>>>导入gi
#尝试gi.so
#尝试gimodule.so
#尝试gi.py
#尝试gi.pyc
#尝试/usr/lib/python2.7/gi.so
#尝试/usr/lib/python2.7/gimodule.so
#尝试/usr/lib/python2.7/gi.py
#尝试/usr/lib/python2.7/gi.pyc
#尝试/usr/lib/python2.7/plat-linux2/gi.so
#尝试/usr/lib/python2.7/plat-linux2/gimodule.so
#尝试/usr/lib/python2.7/plat-linux2/gi.py
#尝试/usr/lib/python2.7/plat-linux2/gi.pyc
#尝试/usr/lib/python2.7/lib-tk/gi.so
#尝试/usr/lib/python2.7/lib-tk/gimodule.so
#尝试/usr/lib/python2.7/lib-tk/gi.py
#尝试/usr/lib/python2.7/lib-tk/gi.pyc
#尝试/usr/lib/python2.7/lib-dynload/gi.so
#尝试/usr/lib/python2.7/lib-dynload/gimodule.so
#尝试/usr/lib/python2.7/lib-dynload/gi.py
#尝试/usr/lib/python2.7/lib-dynload/gi.pyc
#尝试/usr/local/lib/python2.7/dist-packages/gi.so
#尝试/usr/local/lib/python2.7/dist-packages/gimodule.so
#尝试/usr/local/lib/python2.7/dist-packages/gi.py
#尝试/usr/local/lib/python2.7/dist-packages/gi.pyc
导入gi#目录/usr/lib/python2.7/dist-packages/gi
#尝试/usr/lib/python2.7/dist-packages/gi/__init__.so
#尝试/usr/lib/python2.7/dist-packages/gi/__init__module.so
#尝试/usr/lib/python2.7/dist-packages/gi/__init__.py
#/usr/lib/python2.7/dist-packages/gi/__init__.pyc匹配/usr/lib/python2.7/dist-packages/gi/__init__.py
从/usr/lib/python2.7/dist-packages/gi/__init__.pyc预编译import gi#
#尝试__future__.so
#尝试__future__module.so
#尝试__future__.py
#尝试__future __。pyc
#尝试/usr/lib/python2.7/__future__.so
#尝试/usr/lib/python2.7/__future__module.so
#尝试/usr/lib/python2.7/__future__.py
#/usr/lib/python2.7/__future__.pyc匹配/usr/lib/python2.7/__future__.py
从/usr/lib/python2.7/__future__.pyc预编译import __future__#
#尝试/usr/lib/python2.7/dist-packages/gi/_gi.so
dlopen(“ / usr / lib / python2.7 / dist-packages / gi / _gi.so”,2);
导入gi._gobject#目录/usr/lib/python2.7/dist-packages/gi/_gobject
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/__init__.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/__init__module.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/__init__.py
#/usr/lib/python2.7/dist-packages/gi/_gobject/__init__.pyc匹配/usr/lib/python2.7/dist-packages/gi/_gobject/__init__.py
从/usr/lib/python2.7/dist-packages/gi/_gobject/__init__.pyc预编译import gi._gobject#
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/sys.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/sysmodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/sys.py
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/sys.pyc
导入gi._glib#目录/usr/lib/python2.7/dist-packages/gi/_glib
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/__init__.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/__init__module.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/__init__.py
#/usr/lib/python2.7/dist-packages/gi/_glib/__init__.pyc匹配/usr/lib/python2.7/dist-packages/gi/_glib/__init__.py
从/usr/lib/python2.7/dist-packages/gi/_glib/__init__.pyc预编译import gi._glib#
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/_glib.so
dlopen(“ / usr / lib / python2.7 / dist-packages / gi / _glib / _glib.so”,2);
导入gi._glib._glib#从/usr/lib/python2.7/dist-packages/gi/_glib/_glib.so动态加载
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/option.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/optionmodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/option.py
#/usr/lib/python2.7/dist-packages/gi/_glib/option.pyc匹配/usr/lib/python2.7/dist-packages/gi/_glib/option.py
import gi._glib.option#从/usr/lib/python2.7/dist-packages/gi/_glib/option.pyc预编译
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/sys.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/sysmodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/sys.py
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/sys.pyc
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/optparse.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/optparsemodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/optparse.py
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/optparse.pyc
#尝试optparse.so
#尝试optparsemodule.so
#尝试optparse.py
#尝试optparse.pyc
#尝试/usr/lib/python2.7/optparse.so
#尝试/usr/lib/python2.7/optparsemodule.so
#尝试/usr/lib/python2.7/optparse.py
#/usr/lib/python2.7/optparse.pyc匹配/usr/lib/python2.7/optparse.py
从/usr/lib/python2.7/optparse.pyc预编译import optparse#
#尝试textwrap.so
#尝试textwrapmodule.so
#尝试textwrap.py
#尝试textwrap.pyc
#尝试/usr/lib/python2.7/textwrap.so
#尝试/usr/lib/python2.7/textwrapmodule.so
#尝试/usr/lib/python2.7/textwrap.py
#/usr/lib/python2.7/textwrap.pyc匹配/usr/lib/python2.7/textwrap.py
导入从/usr/lib/python2.7/textwrap.pyc预编译的textwrap#
#尝试string.so
#尝试stringmodule.so
#尝试string.py
#尝试string.pyc
#尝试/usr/lib/python2.7/string.so
#尝试/usr/lib/python2.7/stringmodule.so
#尝试/usr/lib/python2.7/string.py
#/usr/lib/python2.7/string.pyc匹配/usr/lib/python2.7/string.py
导入字符串#从/usr/lib/python2.7/string.pyc预编译
导入strop#内置
#尝试gettext.so
#尝试gettextmodule.so
#尝试gettext.py
#尝试gettext.pyc
#尝试/usr/lib/python2.7/gettext.so
#尝试/usr/lib/python2.7/gettextmodule.so
#尝试/usr/lib/python2.7/gettext.py
#/usr/lib/python2.7/gettext.pyc匹配/usr/lib/python2.7/gettext.py
从/usr/lib/python2.7/gettext.pyc预编译import gettext#
#尝试locale.so
#尝试localemodule.so
#尝试locale.py
#尝试locale.pyc
#尝试/usr/lib/python2.7/locale.so
#尝试/usr/lib/python2.7/localemodule.so
#尝试/usr/lib/python2.7/locale.py
#/usr/lib/python2.7/locale.pyc与/usr/lib/python2.7/locale.py匹配
从/usr/lib/python2.7/locale.pyc预编译的import locale#
导入运算符#内置
#尝试functools.so
#尝试functoolsmodule.so
#尝试functools.py
#尝试functools.pyc
#尝试/usr/lib/python2.7/functools.so
#尝试/usr/lib/python2.7/functoolsmodule.so
#尝试/usr/lib/python2.7/functools.py
#/usr/lib/python2.7/functools.pyc匹配/usr/lib/python2.7/functools.py
导入functools#从/usr/lib/python2.7/functools.pyc预编译
导入_functools#内置
导入_locale#内置
#尝试copy.so
#尝试copymodule.so
#尝试copy.py
#尝试copy.pyc
#尝试/usr/lib/python2.7/copy.so
#尝试/usr/lib/python2.7/copymodule.so
#尝试/usr/lib/python2.7/copy.py
#/usr/lib/python2.7/copy.pyc匹配/usr/lib/python2.7/copy.py
从/usr/lib/python2.7/copy.pyc预编译的import copy#
#尝试weakref.so
#尝试weakrefmodule.so
#尝试weakref.py
#尝试weakref.pyc
#尝试/usr/lib/python2.7/weakref.so
#尝试/usr/lib/python2.7/weakrefmodule.so
#尝试/usr/lib/python2.7/weakref.py
#/usr/lib/python2.7/weakref.pyc匹配/usr/lib/python2.7/weakref.py
从/usr/lib/python2.7/weakref.pyc预编译importweakref#
#尝试org.so
#尝试orgmodule.so
#尝试org.py
#尝试org.pyc
#尝试/usr/lib/python2.7/org.so
#尝试/usr/lib/python2.7/orgmodule.so
#尝试/usr/lib/python2.7/org.py
#尝试/usr/lib/python2.7/org.pyc
#尝试/usr/lib/python2.7/plat-linux2/org.so
#尝试/usr/lib/python2.7/plat-linux2/orgmodule.so
#尝试/usr/lib/python2.7/plat-linux2/org.py
#尝试/usr/lib/python2.7/plat-linux2/org.pyc
#尝试/usr/lib/python2.7/lib-tk/org.so
#尝试/usr/lib/python2.7/lib-tk/orgmodule.so
#尝试/usr/lib/python2.7/lib-tk/org.py
#尝试/usr/lib/python2.7/lib-tk/org.pyc
#尝试/usr/lib/python2.7/lib-dynload/org.so
#尝试/usr/lib/python2.7/lib-dynload/orgmodule.so
#尝试/usr/lib/python2.7/lib-dynload/org.py
#尝试/usr/lib/python2.7/lib-dynload/org.pyc
#尝试/usr/local/lib/python2.7/dist-packages/org.so
#尝试/usr/local/lib/python2.7/dist-packages/orgmodule.so
#尝试/usr/local/lib/python2.7/dist-packages/org.py
#尝试/usr/local/lib/python2.7/dist-packages/org.pyc
#尝试/usr/lib/python2.7/dist-packages/org.so
#尝试/usr/lib/python2.7/dist-packages/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/org.py
#尝试/usr/lib/python2.7/dist-packages/org.pyc
#尝试/usr/lib/python2.7/dist-packages/PIL/org.so
#尝试/usr/lib/python2.7/dist-packages/PIL/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/PIL/org.py
#尝试/usr/lib/python2.7/dist-packages/PIL/org.pyc
#尝试/usr/lib/python2.7/dist-packages/gst-0.10/org.so
#尝试/usr/lib/python2.7/dist-packages/gst-0.10/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/gst-0.10/org.py
#尝试/usr/lib/python2.7/dist-packages/gst-0.10/org.pyc
#尝试/usr/lib/python2.7/dist-packages/gtk-2.0/org.so
#尝试/usr/lib/python2.7/dist-packages/gtk-2.0/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/gtk-2.0/org.py
#尝试/usr/lib/python2.7/dist-packages/gtk-2.0/org.pyc
#尝试/usr/lib/pymodules/python2.7/org.so
#尝试/usr/lib/pymodules/python2.7/orgmodule.so
#尝试/usr/lib/pymodules/python2.7/org.py
#尝试/usr/lib/pymodules/python2.7/org.pyc
#尝试/usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.so
#尝试/usr/lib/python2.7/dist-packages/ubuntu-sso-client/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.py
#尝试/usr/lib/python2.7/dist-packages/ubuntu-sso-client/org.pyc
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-client/org.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-client/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-client/org.py
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-client/org.pyc
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-control-panel/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.py
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-control-panel/org.pyc
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-couch/org.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-couch/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-couch/org.py
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-couch/org.pyc
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-installer/org.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-installer/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-installer/org.py
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-installer/org.pyc
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/orgmodule.so
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.py
#尝试/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol/org.pyc
#尝试struct.so
#尝试structmodule.so
#尝试struct.py
#尝试struct.pyc
#尝试/usr/lib/python2.7/struct.so
#尝试/usr/lib/python2.7/structmodule.so
#尝试/usr/lib/python2.7/struct.py
#/usr/lib/python2.7/struct.pyc与/usr/lib/python2.7/struct.py匹配
从/usr/lib/python2.7/struct.pyc预编译导入struct#
导入_struct#内置
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/gi.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/gimodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/gi.py
#尝试/usr/lib/python2.7/dist-packages/gi/_glib/gi.pyc
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/constants.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/constantsmodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/constants.py
#/usr/lib/python2.7/dist-packages/gi/_gobject/constants.pyc匹配/usr/lib/python2.7/dist-packages/gi/_gobject/constants.py
import gi._gobject.constants#从/usr/lib/python2.7/dist-packages/gi/_gobject/constants.pyc预编译
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so
dlopen(“ / usr / lib / python2.7 / dist-packages / gi / _gobject / _gobject.so”,2);
从/usr/lib/python2.7/dist-packages/gi/_gobject/_gobject.so动态加载import gi._gobject._gobject#
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelpermodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.py
#/usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.pyc匹配/usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.py
从/usr/lib/python2.7/dist-packages/gi/_gobject/propertyhelper.pyc预编译的import gi._gobject.propertyhelper#
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrappermodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.py
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.pyc
#尝试datetime.so
#尝试datetimemodule.so
#尝试datetime.py
#尝试datetime.pyc
#尝试/usr/lib/python2.7/datetime.so
#尝试/usr/lib/python2.7/datetimemodule.so
#尝试/usr/lib/python2.7/datetime.py
#尝试/usr/lib/python2.7/datetime.pyc
#尝试/usr/lib/python2.7/plat-linux2/datetime.so
#尝试/usr/lib/python2.7/plat-linux2/datetimemodule.so
#尝试/usr/lib/python2.7/plat-linux2/datetime.py
#尝试/usr/lib/python2.7/plat-linux2/datetime.pyc
#尝试/usr/lib/python2.7/lib-tk/datetime.so
#尝试/usr/lib/python2.7/lib-tk/datetimemodule.so
#尝试/usr/lib/python2.7/lib-tk/datetime.py
#尝试/usr/lib/python2.7/lib-tk/datetime.pyc
#尝试/usr/lib/python2.7/lib-dynload/datetime.so
dlopen(“ / usr / lib / python2.7 / lib-dynload / datetime.so”,2);
import datetime#从/usr/lib/python2.7/lib-dynload/datetime.so动态加载
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrappermodule.so
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.py
#尝试/usr/lib/python2.7/dist-packages/gi/_gobject/GTypeWrapper.pyc
import gi._gi#从/usr/lib/python2.7/dist-packages/gi/_gi.so动态加载