gpt4 book ai didi

python - 导入错误: cannot import name IPossibleSitenterfaces import IPossibleSite: version mismatch?

转载 作者:行者123 更新时间:2023-12-01 05:58:21 25 4
gpt4 key购买 nike

学习者提醒

FreeBSD 9.0

这是第一次工作:

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

但是在“Professional Plone 4 Development”之后,无法让 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

我egrepped plonedev树并在/usr/home/mydir/plonedev/eggs/zope.location-4.0.0-py2.7.egg/EGG-INFO/PKG-INFO中找到:

    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``).

看起来我遇到了一些版本不匹配的问题,但不确定它是如何出现的,也不知道如何修复它。

最佳答案

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

大多数 Plone 用户使用 buildout 来获取设置了正确版本的 zope 实例。我希望 Professional Plone 4 Development 也会推荐这一点。

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

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

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

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

关于python - 导入错误: cannot import name IPossibleSitenterfaces import IPossibleSite: version mismatch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11544203/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com