Building Plone 4.0 core-dev on OS X Leopard 10.5
update 1: there is python26 in MacPorts.
After the great Plone Conference 2009 that was held from wednesday to friday we are now sprinting two more days. I guess there’s more than 200 people sprinting on saturday and sunday, improving Plone in all area’s: documentation, code, add-ons, you name it.
I gave up on getting plone 4.0 coredev running on my mac a few months ago after five minutes when something started to complain, but with all the gread minds around me in Budapest and a slide show by Maurits I wanted to get it running now. But it’s still painfull for some reason and I have I have no clue why it works for everybody else but not for me. Anyway, here are the roadblocks I bumped into installing it on OS X Leopard 10.5 .
Python 2.6
You need python 2.6 to run Plone 4. OS X leopard comes default with an older python 10.5. For doing my Plone 3.X projects I use the python2.4 from macports, which works great, but macports for Leopard doesn’t have a python 2.6 package. Snow Leopard raised the bar by including support for both 32bit and 64bit in python, and causing a lot of pain to build other python versions from source, because they might link to the wrong 32bit or 64bit support libraries.
Florian Schulze created a buildout builds python 2.4/2.5 and 2.6 for you, paying attention to all the dependencies. It’s major goal was to simplify install on Snow Leopard but it works on Leopard 10.5 as well. Or: it should, because it doesn’t for me, it stops when trying to compile python 2.4. Solution: remove all references to python 2.4 and 2.5 from the buildout.cfg : you only need python 2.6 for Plone 4 and the other versions are already there from macports or the system python. Hurdle one taken, I have a python 2.6.
Distribute madness
After fetching the Plone 4 development branch from http://svn.plone.org/svn/plone/buildouts/plone-coredev/branches/4.0 , doing a python2.6 bootstrap.py and running bin/buildout, the buildout coun’t install mr.developer.
# ImportError: <module ’setuptools.dist’ from ‘/Users/fred/buildouts/pythons/python-2.6/lib/python2.6/site-packages/distribute-0.6.3-py2.6.egg/setuptools/dist.pyc’> has no ‘check_packages’ attribute# An error occured when trying to install mr.developer 1.1.Look above this message for any errors thatwere output by easy_install.
Now what. For some reason the included Distribute version was still stuck at 0.6.3, when 0.6.6. is the most recent version. So I created a python 2.6 virtualenv from my pythons 2.6 buildout (virtualenv-2.6 is created in the bin folder there) and installed 0.6.6 by using the easy_install from the newly created virtualenv. By the way, distribute is the succesor to the setuptools package.
After having a virutalenv with up to date distribute I used it to bootstrap my Plone 4 coredev buildout again and run bin/buildout. jay!
mr.developer is drunk
Buildout finished with a report that mr.developer couldn’t find some sources. You can list them by running bin/develop status, they have exclamation marks before them. In particular, Products.CMFQuickInstaller and Products.PlacelessTranslationService were not installed by mr.developer in the src/ subfolder. I checked paths, checked with other sprinters, did an svn update, reran bin/buildout, nothing. In the end I just did a manual svn checkout of the two packages with the links provided in the sources.cfg from the Plone4 core-dev in the src folder.
Swallow the blue PILl
bin/instance fg to start Plone 4 and…… we have no PIL module. Ah, right, I created a virtualenv without site-packages for the python2.6 to install Distribute. Been there, done that. There’s an easy way to add the Python Imaging (alias PIL) to your virtualenv by running easy_install http://dist.plone.org/thirdparty/PILwoTk-1.1.6.4.tar.gz .
And we’re up and running with a Plone 4 test buildout on OS X Leopard 10.5 . Finally.
Update 1
Apparently I had a serious headache or my macports was messed up when I search for Python 2.6 in macports two weeks ago. Alec Mitchell points out it has been there for a long time, just search for with port search python26. After installing python 2.6 with sudo port install python26 and not forgetting to install py26-pil as well, all of the above mentionned problems with distribute and mr.developer are gone. Pfew.

October 31st, 2009 at 23:36
sudo port install python26: check !
sudo port install py26-pil: check !
svn co https://svn.plone.org/svn/plone/buildouts/plone-coredev/branches/4.0/ Plone4: check !
python2.6 bootstrap.py: check !
bin/buildout
…
Installing coverage-test.
…
mr.developer: There have been errors during checkout, check the output above or use ‘develop status’.
I can start up the instance (bin/instance start), but localhost:8080 gives me the ZMI, not the new fancy “Plone is up and running” screen.
In the Add dropdown “Plone site” seems to be missing …
Anyone?
November 1st, 2009 at 08:30
For what it’s worth, I was able to install Plone 4 on Snow Leopard using the system-supplied Python. I did have a clean install, though — not sure if that makes a difference.
Thanks for writing up this guide, I’m sure there are others that are in the same situation until we ship the official installers.