veni vidi Scripsi

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 main­te­nance 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 'de­vel­op­er' buildout install, which is what I used as a reference. So, let's get started.

Prepa­ra­tions

  1. Make sure you've got XCode installed;

  2. Install pip, use the in­struc­tions in the doc­u­men­ta­tion;

  3. Install virtualenv and vir­tualen­vwrap­per (the latter is not strictly necessary, but will make your life a lot easier):

    sudo pip install virtualenv virtualenvwrapper
    
  4. I have a special folder in my system where I keep all my vir­tualen­vs together (in /Volumes/DATA/vir­tualen­vs - 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) vir­tualen­vs. 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
    
  5. Create a virtualenv for your Plone in­stal­la­tion:

    cd /Volumes/DATA/virtualenvs
    mkvirtualenv plone
    

    The virtualenv is au­to­mat­i­cal­ly 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/vir­tualen­vwrap­per 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.

  1. Now install ZopeSkel:

    pip install 'ZopeSkel<2.99'
    
  2. 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 my­plone­fold­er with some necessary buildout files.

  3. 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
    
  4. Now run the following (this will take a while):

    bin/buildout
    

    And again you might run into errors, mainly the following:

    • Remove dump­picked­ver­sions:

      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.dump­picked­ver­sions 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 in­ter­preter 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"
Recipe: Spinach, Tomato, Goat's Cheese, Potato & Egg Wraps » « Upgrading the Mac from Snow Leopard / Lion to Mavericks