我使用https://github.com/plone/plonedev.vagrant在Windows上设置了plone4.3开发环境。我一直试图在我的安装中增加灵巧的支持,但是遇到了问题。
我所采取的步骤如下:
我重新运行buildout并尝试在前台模式下启动服务器,但是获得以下跟踪:
vagrant@precise32:~$ ./runbin.sh plonectl fg
instance: Traceback (most recent call last):
File "/home/vagrant/Plone/zinstance/bin/instance", line 290, in <module>
import plone.recipe.zope2instance.ctl
File "/home/vagrant/Plone/buildout-cache/eggs/plone.recipe.zope2instance-4.2.9-py2.7.egg/plone/recipe/__init__.py", line 1, in <module>
__import__('pkg_resources').declare_namespace(__name__)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 704, in subscribe
callback(dist)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2262, in activate
map(declare_namespace, self._get_metadata('namespace_packages.txt'))
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1847, in declare_namespace
_handle_ns(packageName, path_item)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1817, in _handle_ns
loader.load_module(packageName); module.__path__ = path
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/basic_namespace.py", line 2, in <module>
from zopeskel.vars import var, DottedVar, StringVar, BooleanVar, TextVar
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/vars.py", line 2, in <module>
from paste.script.templates import var as base_var
ImportError: No module named script.templates编辑:我忘了提到buildout.cfg扩展了base.cfg,它包含以下内容:
[zopeskel]
# installs paster and Zopeskel
recipe = zc.recipe.egg
eggs =
ZopeSkel
Paste
PasteDeploy
PasteScript
${buildout:eggs}我刚刚尝试显式地将PasteScript添加到buildout.cfg中的鸡蛋部分。在运行buildout并尝试启动服务器之后,我得到了一个不同的跟踪:
vagrant@precise32:~$ ./runbin.sh plonectl fg
instance: Traceback (most recent call last):
File "/home/vagrant/Plone/zinstance/bin/instance", line 291, in <module>
import plone.recipe.zope2instance.ctl
File "/home/vagrant/Plone/buildout-cache/eggs/plone.recipe.zope2instance-4.2.9-py2.7.egg/plone/recipe/__init__.py", line 1, in <module>
__import__('pkg_resources').declare_namespace(__name__)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 704, in subscribe
callback(dist)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2835, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 2262, in activate
map(declare_namespace, self._get_metadata('namespace_packages.txt'))
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1847, in declare_namespace
_handle_ns(packageName, path_item)
File "/home/vagrant/Plone/buildout-cache/eggs/distribute-0.6.28-py2.7.egg/pkg_resources.py", line 1817, in _handle_ns
loader.load_module(packageName); module.__path__ = path
File "/usr/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/__init__.py", line 2, in <module>
from zopeskel.basic_namespace import BasicNamespace
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/basic_namespace.py", line 2, in <module>
from zopeskel.vars import var, DottedVar, StringVar, BooleanVar, TextVar
File "/home/vagrant/Plone/buildout-cache/eggs/ZopeSkel-2.21.2-py2.7.egg/zopeskel/vars.py", line 2, in <module>
from paste.script.templates import var as base_var
File "/vagrant/plone/src/hello.world/PasteScript-1.7.5-py2.7.egg/paste/script/templates.py", line 9, in <module>
from paste.util.template import paste_script_template_renderer
ImportError: No module named util.template这是我的Python路径的问题吗?我运行了bin/zopepy,然后执行了import paste;print paste.__file__,输出是:
/vagrant/plone/src/hello.world/PasteScript-1.7.5-py2.7.egg/paste/__init__.pyc粘贴-1.7.5.1鸡蛋目录确实包含一个粘贴/util/template.py文件,但看起来解释器找不到它。
发布于 2013-07-15 11:53:32
您不需要在Plone 4.3中增加灵巧性,它已经包括:
发布于 2013-07-15 11:46:42
正如 PyPI page上记录的那样,您也需要包含PasteScript蛋;跟踪显示它丢失了:
[zopeskel]
recipe = zc.recipe.egg
eggs =
ZopeSkel < 3.0dev
Paste
PasteDeploy
PasteScript
zopeskel.dexterity
${buildout:eggs}发布于 2013-07-16 01:55:26
你可能做了比你需要做的更多的工作。plonedev.vagrant工具包附带zopeskel和zopeskel.dexterity预装。请看这份成绩单:
steve@lumpy:~/plonedev_vagrant$ vagrant up
[default] Importing base box 'precise32'...
...
steve@lumpy:~/plonedev_vagrant$ vagrant ssh
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-48-generic i686)
...
vagrant@vagrant-ubuntu-precise-32:~/Plone/zinstance$ ll bin
...
-rwxr-xr-x 1 vagrant vagrant 20023 Jul 16 01:41 zopeskel*
...
vagrant@vagrant-ubuntu-precise-32:~/Plone/zinstance$ cd src
...
vagrant@vagrant-ubuntu-precise-32:~/Plone/zinstance/src$ ~/Plone/zinstance/bin/zopeskel dexterity
dexterity: A Dexterity-based product
...其中有一点神奇之处:由于plonedev.vagrant工具包象征性地链接了src目录,所以不能使用“./bin/zopeskel”。这就是使用"~/Plone/zinstance/bin/zopeskel灵巧度“命令的原因。
我们要么把这个奇怪的东西记录下来,要么想办法避免它。
https://stackoverflow.com/questions/17652753
复制相似问题