我正在按照《Professional Plone 4 Development》一书开头的说明设置开发环境。我采取了以下步骤。
首先,我创建了一个名为 virtualenvpln
的项目目录,也称为pln
其次,我将 PIL 安装到pln
virtualenv 中。
第三,我创建了一个buildout.cfg
包含以下内容的文件:
[buildout]
extends = http://dist.plone.org/release/4.2/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
eggs = Plone
四、我bootstrap.py
从http://svn.plone.org/svn/plone/buildouts/plone-coredev/branches/4.2/bootstrap.py下载
第五,我运行了命令python bootstrap.py --distribute
,它给出了以下输出:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.29.tar.gz
Extracting in /var/folders/xk/5xt9s5vd4bqd731qdkmxkxyr0000gn/T/tmpwMBNe9
Now working in /var/folders/xk/5xt9s5vd4bqd731qdkmxkxyr0000gn/T/tmpwMBNe9/distribute-0.6.29
Building a Distribute egg in /var/folders/xk/5xt9s5vd4bqd731qdkmxkxyr0000gn/T/tmpKSPdWX
/var/folders/xk/5xt9s5vd4bqd731qdkmxkxyr0000gn/T/tmpKSPdWX/distribute-0.6.29-py2.7.egg
Creating directory '/Users/Jon/dev/pln/bin'.
Creating directory '/Users/Jon/dev/pln/parts'.
Creating directory '/Users/Jon/dev/pln/eggs'.
Creating directory '/Users/Jon/dev/pln/develop-eggs'.
Generated script '/Users/Jon/dev/pln/bin/buildout'.
第六,从项目目录中运行命令bin/buildout
。有一段时间似乎一切正常,但随后我开始收到大量类似于以下的错误消息:
SyntaxError: ("'return' outside function", ('build/bdist.macosx-10.8-x86_64/egg/Products/kupu/plone/kupu_plone_layer/convertContentForKupu.py', 23, None, 'return str(content)\n'))
SyntaxError: ("'return' outside function", ('/Users/Jon/dev/pln/eggs/tmpEwAZSu/Products.CMFPlone-4.2.0.1-py2.7.egg/Products/CMFPlone/skins/plone_scripts/redirectToReferrer.py', 18, None, 'return request.RESPONSE.redirect(target_url)\n'))
SyntaxError: ("'return' outside function", ('build/bdist.macosx-10.8-x86_64/egg/Products/Archetypes/skins/archetypes/unicodeTestIn.py', 11, None, 'return 0\n'))
最后,运行bin/buildout
失败并出现以下错误:
While: Installing instance.
Getting distribution for 'plone.outputfilters==1.3'.
An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/Users/Jon/dev/pln/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/buildout.py", line 1683, in main
getattr(buildout, command)(args)
File "/Users/Jon/dev/pln/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/buildout.py", line 555, in install
installed_files = self[part]._call(recipe.install)
[about 50 lines of stack trace admitted for brevity...]
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 365, in _read_status
line = self.fp.readline()
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
error: [Errno 54] Connection reset by peer
为什么连接在最后被对等方重置?这是哪个对等方,我如何控制这样的错误?
非常感谢您的帮助。