导入这些 Python 模块时,您会遇到某种异常。要调试,您可以找到 Zope2 的一部分 ClassFactory.py 并直接对其进行修改以显示确切的错误消息:
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
"""Zope Framework Class Finder
"""
import OFS.Uninstalled
def ClassFactory(jar, module, name,
_silly=('__doc__',), _globals={},
):
# Add the following code:
if module in [
'Products.Ezonus.projektai2.ezonus2.control.system.Photos',
'Products.Ezonus.projektai2.ezonus2.control.system.FailuArchyvas'
]:
m=__import__(module, _globals, _globals, _silly)
# ^^^
try:
m=__import__(module, _globals, _globals, _silly)
return getattr(m, name)
except:
return OFS.Uninstalled.Broken(jar, None, (module, name))
对我来说,确切的文件路径是eggs/Zope2-2.13.22-py2.7.egg/Zope2/App/ClassFactory.py。
很可能,您缺少一些需要安装的 Ubuntu 软件包。