I’m following the instructions for setting up a development environment which can be found at the beginning of the book Professional Plone 4 Development. I took the following steps.
First, I created a virtualenv called pln and a project directory also called pln
Second, I installed PIL into the pln virtualenv.
Third, I created a buildout.cfg file with the following contents:
[buildout]
extends = http://dist.plone.org/release/4.2/versions.cfg
parts = instance
[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
eggs = Plone
Fourth, I downloaded bootstrap.py from http://svn.plone.org/svn/plone/buildouts/plone-coredev/branches/4.2/bootstrap.py
Fifth, I ran the command python bootstrap.py --distribute, which gave the following output:
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'.
Sixth, from the project directory I ran the command bin/buildout. Everything seemed to work okay for a while, but then I began getting scores of error messages similar to these below:
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'))
Finally, running bin/buildout fails with the following error:
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
Why is the connection reset by the peer at the end there? Which peer is this, and how can I have any control over an error like this?
Thanks much, in advance, for your help.
From the book “Professional Plone 4 Development” I have the answer to why I am getting syntax errors:
I’m still not sure why
bin/buildoutfails, however. I just tried again with everything fresh and I got this error:While: Installing. Getting section instance. Initializing section instance. Installing recipe plone.recipe.zope2instance. Getting distribution for 'docutils==0.9.1'. 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/pl/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/pl/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/buildout.py", line 439, in install [self[part]['recipe'] for part in install_parts] ** 50 OR SO LINES OF STACK TRACE OMITTED 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) timeout: timed outEDIT: Okay, I’ve figured out that the whole thing just doesn’t work with Plone 4.2. Just make everything 4.1 instead and it will
bin/buildoutwill finish without crashing.