ImportError:无法导入名称IPossibleSitenterfaces导入IPossibleSite:版本不匹配?

时间:2012-07-18 14:51:40

标签: python plone zope

学员警报

FreeBSD 9.0

这是第一次工作:

http://plone.org/documentation/manual/installing-plone/installation-quick-guide

但是,遵循“专业Plone 4开发”,未能获得一个virtualenv工作

在我的virtualenv dir plonedev中:

bin/instance fg

2012-07-18 09:04:58 INFO ZServer HTTP server started at Wed Jul 18 09:04:58 2012
        Hostname: 0.0.0.0
        Port: 8080

Traceback (most recent call last):

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
    run()

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/run.py", line 22, in run
    starter.prepare()

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/__init__.py", line 86, in prepare
    self.startZope()

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/Zope2/Startup/__init__.py", line 259, in startZope
    Zope2.startup()

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/Zope2/__init__.py", line 46, in startup
    from Zope2.App.startup import startup as _startup

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/Zope2/App/startup.py", line 38, in <module>
    import OFS.Application

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/OFS/Application.py", line 22, in <module>
    import App.Product

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/App/Product.py", line 44, in <module>
    from OFS.Folder import Folder

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/OFS/Folder.py", line 24, in <module>
    from webdav.Collection import Collection

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/webdav/Collection.py", line 30, in <module>
    from webdav.Resource import Resource

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/webdav/Resource.py", line 35, in <module>
    from OFS.event import ObjectClonedEvent

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/OFS/event.py", line 20, in <module>
    import OFS.interfaces

  File "/usr/home/mydir/plonedev/eggs/Zope2-2.13.15-py2.7.egg/OFS/interfaces.py", line 19, in <module>
    from zope.location.interfaces import IPossibleSite

ImportError: cannot import name IPossibleSitenterfaces import IPossibleSite

我在/usr/home/mydir/plonedev/eggs/zope.location-4.0.0-py2.7.egg/EGG-INFO/PKG-INFO

中找到了plonedev树
    4.0.0 (2012-06-07)
    ------------------

    - Removed backward-compatibility imports:

      - ``zope.copy.clone`` (aliased as ``zope.location.pickling.locationCopy``)

      - ``zope.copy.CopyPersistent`` (aliased as
        ``zope.location.pickling.CopyPersistent``).

      - ``zope.site.interfaces.IPossibleSite`` (aliased as
        ``zope.location.interfaces.IPossibleSite``).

看起来我有一些版本不匹配,但不确定它是如何到达那里,也不确定如何解决它。

1 个答案:

答案 0 :(得分:2)

您需要旧版本的zope.location:3.9.1。

大多数Plone用户使用buildout来处理设置正确版本的zope实例。我希望专业Plone 4开发也能推荐它。

如果你想在virtualenv中手动处理它,你需要查看包的KGS(已知良好集),这也是buildout所做的。对于Zope2 2.13.15,它在这里: http://download.zope.org/Zope2/index/2.13.15/versions.cfg

zope.location本身不在那里,但在顶部它说:

extends = http://download.zope.org/zopetoolkit/index/1.0.7/ztk-versions.cfg

如果您查看该文件,您将看到zope.location 3.9.1。