从Plone 4.2.1迁移的Plone 4.3a2给出了Archetypes ImportError:无法导入名称Schema错误

时间:2012-10-21 14:11:23

标签: plone buildout

我一直在使用Plone 4.2没有问题,但想用即将推出的Plone 4.3来测试我的网站。我编辑了我的buildout以使用Plone 4.3a2和reran buildout。

现在我得到ImportError: cannot import name Schema

这就是我的扩展部分现在看起来的样子(我已经将Plone 4.2的旧注释添加到新的Plone 4.3a2网址中)。

extends =
    deco.cfg
    toolbar.cfg
    users-ports.cfg
    base.cfg
    supervisor-cache-balancer.cfg
    products.cfg
#    versions.cfg
#    http://dist.plone.org/release/4.2-latest/versions.cfg
   http://dist.plone.org/release/4.3a2/versions.cfg
   pinnedversions.cfg

重新运行buildout并使用bin/client1 fg

启动我的实例

我得到以下追溯:

from Products.ATContentTypes.criteria import _criterionRegistry
  File "/home/plone/buildout-cache/eggs/Products.ATContentTypes-2.1.7-py2.7.egg/Products/ATContentTypes/criteria/__init__.py", line 123, in <module>
    from Products.ATContentTypes.criteria.relativepath import ATRelativePathCriterion
  File "/home/plone/buildout-cache/eggs/Products.ATContentTypes-2.1.7-py2.7.egg/Products/ATContentTypes/criteria/relativepath.py", line 7, in <module>
    from Products.Archetypes.public import Schema, DisplayList
ImportError: cannot import name Schema

我甚至尝试将Archetypes和ATContentypes固定,以便buildout使用旧版本(例如Plone 4.2中使用的那些版本),将以下内容添加到我的pinnedversions.cfg文件中(在其他所有内容后调用)。

[versions]
Products.ATContentTypes = 2.1.7
Products.Archetypes = 1.7.14

即便如此,似乎还有更多内容, ImportError:无法导入名称架构错误仍然存​​在。我在pinnedversions.cfg文件中使用的版本无关紧要。

我所有的调查都表明这应该“正常”。这是我到目前为止所检查的内容:

  1. 使用bin/client1 debug进行问题排查后,我发现from Products.Archetypes import Schemafrom Products.Archetypes.Schema import Schemafrom Products.Archetypes.atapi import Schema都有效。

  2. 当我打开Products.Archetypes public.py文件时,它包含以下行:

     from Products.Archetypes.atapi import *
    

    我的理解是这样一行可以从public.py导入Schema。

2 个答案:

答案 0 :(得分:1)

只是为了确认启用products.kupu也会给我带来麻烦。

最新的plone.app.upgrade修复了此问题,请参阅https://github.com/plone/plone.app.upgrade/commit/676f43c9c9c56eb686e20a5d0c7319540e7bab3f

答案 1 :(得分:0)

在干净的4.3a2扩建和我的扩建之间进行进一步调查之后,差异为Products.kupu,从我的Product.kupu部分注释掉eggs并重新运行buildout解决了问题。

我没有调查过这个解决问题的原因,但确实如此。

相关问题