Installing & Running Plone 4.3 on Mac OS X Mavericks
So, I'm finally getting to know Plone. We will be using it for the company website and I should be getting a short training in working and developing with Plone so I can take on the maintenance of the website after delivery.
I had some extra time to delve into Plone before the training and I have to say: Plone definitely has a steep learning curve. It toke me forever just to get it up and running (not being familiar with zc.buildout doesn't help). Just now I had to help my colleague getting everything up and running and he ran into many of the same problems as I did, so I thought I'd document the process for future reference.
My coleague started with using the default packaged installer, but then couldn't get it running (something wrong with port numbers). So I suggested he'd try the 'developer' buildout install, which is what I used as a reference. So, let's get started.
Preparations
Make sure you've got XCode installed;
Install pip, use the instructions in the documentation;
Install virtualenv and virtualenvwrapper (the latter is not strictly necessary, but will make your life a lot easier):
sudo pip install virtualenv virtualenvwrapper
I have a special folder in my system where I keep all my virtualenvs together (in /Volumes/DATA/virtualenvs - yes, I have 2 partitions on my Mac - ). If you have the same you can use the following code in your .bashrc to be able to quickly start (source) virtualenvs. This code also makes sure that pip only works when a virtualenv is active (you will not be able to install Python modules in the global site-packages folder using pip unless you disable that line in .bashrc):
##### PIP/Virtualenvwrapper config ############################################ export PIP_REQUIRE_VIRTUALENV=true source /usr/local/bin/virtualenvwrapper.sh export WORKON_HOME=/Volumes/DATA/virtualenvs ###############################################################################
Don't forget to resource your .bashrc:
. ~/.bashrc
Create a virtualenv for your Plone installation:
cd /Volumes/DATA/virtualenvs mkvirtualenv plone
The virtualenv is automatically activated when you create it. To deactivate it type deactivate. To start (activate) it when it's not active type workon plone (here's where the .bashrc/virtualenvwrapper magic comes in, you can do this wherever you are on the system).
Installing Plone
Everything from here on is done with the virtualenv active.
Now install ZopeSkel:
pip install 'ZopeSkel<2.99'
Go somewhere on your system where you would like Plone to live (this does not have to be in your virtualenv, in fact I prefer very much to keep them separated) and do:
paster create -t plone4_buildout myplonefolder
When it asks for the version number the default is 4.1. This is NOT the latest version. Please type in 4.3 (or the latest version number which you should be able to find on the Plone website). It has now created a folder myplonefolder with some necessary buildout files.
Go into the new folder and run:
python bootstrap.py
Now you might run into the following error:
Traceback (most recent call last): File "bootstrap.py", line 97, in <module> pythonpath = ws.find(pkg_resources.Requirement.parse(requirement)).location AttributeError: 'NoneType' object has no attribute 'location'
To solve this you have to install distribute and rerun python bootstrap.py:
pip install distribute
Now run the following (this will take a while):
bin/buildout
And again you might run into errors, mainly the following:
Remove dumppickedversions:
While: Installing. Loading extensions. Error: Buildout now includes 'buildout-versions' (and part of the older 'buildout.dumppickedversions'). Remove the extension from your configuration and look at the 'show-picked-versions' option in buildout's documentation.
Solve this by editing buildout.cfg and removing (or commenting out) buildout.dumppickedversions from extensions on line 26 and rerun bin/buildout:
extensions = mr.developer # buildout.dumppickedversions
ZopeSkel version conflict:
Got zopeskel.dexterity 1.5.2. While: Installing zopeskel. Error: There is a version conflict. We already have: ZopeSkel 3.0b3 but zopeskel.dexterity 1.5.2 requires 'ZopeSkel<=3.0dev'.
Solve this by editing the buildout.cfg file and adding <=3.0dev to ZopeSkel on line 83 and rerun bin/buildout:
[zopeskel] recipe = zc.recipe.egg eggs = ZopeSkel<=3.0dev PasteScript zopeskel.dexterity
Starting Plone
Finally you can start plone by running the following command from the Plone folder:
bin/instance fg
By using fg you make it run in the foreground so you get error messages in the terminal.
You no longer need your virtualenv active for this. The virtualenv Python interpreter is defined at the start of instance so it actually uses the virtualenv even if it's not active when you run instance.
You might get an error about an 'unknown locale: UTF-8'. You can solve this by adding the following to your .bashrc, sourcing .bashrc and restarting Plone.
export LANG="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"