Personal tools
You are here: Home Documentation Tutorials Managing projects with zc.buildout Prerequisites
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Prerequisites

A few things you need before we can get started

Martin Aspeli

Learn about eggs, setuptools and dependency management, and how to use zc.buildout to set up a development environment.
Page 3 of 9.

Before we can create a buildout to manage Zope and Plone, there are a few prerequisites to take care of.

First, you will need an appropriate Python interpreter, if you do not have one already:

  • Install Python 2.4 for your platform, and add it to your system PATH. It is easiest if Python 2.4 is what you get when you type python -V on a command line.
  • If you installed Python using an operating system package (e.g. an RPM), make sure you get the development package (e.g. python-devel) as well. This includes Python header files that we will use later to compile Zope. If you installed from source, or used the Python Windows installer, you should already have these.
  • Install PIL, the Python Imaging Library into this Python interpreter.

Then, download ez_setup.py and run it with:

$ python ez_setup.py

This will download and install setuptools and the easy_install script. Watch the console output to understand where easy_install is installed. If this is not in your system PATH, you should add this directory to the path as well.

Finally, use easy_install to get ZopeSkel, a collection of skeleton templates for Zope and Plone development:

$ easy_install -U ZopeSkel

This will get Paste Script and various other dependencies. If you added the Python console scripts directory (where easy_install was placed) to your system path, you should now be able to run the paster command. You can test it with:

$ paster create --list-templates
Available templates:
  basic_namespace:          A project with a namespace package
  basic_package:            A basic setuptools-enabled package
  basic_zope:               A Zope project
  nested_namespace:         A project with two nested namespaces.
  plone:                    A Plone project
  plone2.5_theme:           A Theme for Plone 2.5
  plone2_theme:             A Theme for Plone 2.1 & Plone 2.5
  plone3_buildout:          A buildout for Plone 3 projects
  plone3_theme:             A Theme for Plone 3.0
  plone_app:                A Plone App project

Your output may differ slightly, but make sure you have the plone3_buildout and plone templates at least.

Additional installation steps for Windows

If you are using Windows, there are a few more things you need to do.

First, get and install the Python Win32 extensions for Python 2.4.

If you intend to compile Zope yourself, rather than using a binary installer, or if you ever need to compile an egg with C extensions, you will need the mingw32 compiler. Make sure you choose the "base" and "make" modules at a minimum when the installer asks. By default, this installs into C:\MingW32. Inside the installation directory, there will be a bin directory, e.g. C:\MingW32\bin. Add this to your system PATH.

Finally, you need to configure Python's distutils package to use the mingw32 compiler. Create a file called distutils.cfg in the directory C:\Python24\Lib\distutils (presuming Python was installed in C:\Python24, as is the default). Edit this with Notepad, and add the following:

[build]
compiler=mingw32
 
by Martin Aspeli last modified August 29, 2007 - 14:35 All content is copyright Plone Foundation and the individual contributors.

Extra steps on Windows XP

Posted by Larry Pitcher at October 31, 2007 - 18:14
I installed a buildout on a clean Windows XP virtual machine and there were a couple of extra steps required:

Install libxml2 python bindings using this installer:

http://users.skynet.be/sbi/libxml-python/libxml2-python-2.6.27.win32-py2.5.exe

Install mfc71.dll in C:\Windows\system32\. This is required by the Python Windows Extensions, and is found here:

http://python.net/crew/mhammond/downloads/mfc71.dll

Thanks for the great documentation!

Larry Pitcher

windows python 2.4 extensions

Posted by matthew lange at February 5, 2008 - 22:57
The above might work, but since python 2.4 is currently needed, I think that users will probably to use the Libxml and Libxslt extensions for 2.4 found at: http://users.skynet.be/sbi/libxml-python/binaries/libxml2-python-2.6.30.win32-py2.4.exe

Cheers,

matthew lange

Good Catch!

Posted by Larry Pitcher at February 5, 2008 - 23:08
You're right of course, Matthew. I must have copied/pasted the wrong link... Thanks for the correction.

Larry Pitcher

Permission denied

Posted by Jan Ulrich Hasecke at November 6, 2007 - 10:22
When I execute python ez_setup.py python wants to write into its site-packages directory, so I get a Permission denied signal, when I do this as normal user. Do I have to type in sudo python ez_setup.py? And will that affect the installation?

Re: permission denied

Posted by Maciej Wisniowski at November 12, 2007 - 17:01
You should (or even have to) use 'sudo'. This is correct way of installing eggs, etc.

Only for global eggs

Posted by Martin Aspeli at November 12, 2007 - 17:15
Please note that this is only necessary for "global" eggs, e.g. ZopeSkel or setuptools itself (via ez_setup.py), if you're not using virutalenv or similar.

Buildout itself should never need to be run as root.

that depends on your current directory, of course

Posted by John DeStefano at March 18, 2008 - 19:15
If you're installing into a system directory, or another directory owned by "root", you'd need to be root or have root permissions in order to do anything useful (like install, run your instance, etc.). If you *must* do so, run "paster" as root or sudo, change ownership (chown -R) of the resulting directory to yourself (or another user account), and you can do the rest as a "normal" user.

Python 2.5

Posted by unset at November 26, 2007 - 13:38
I want to install Plone 3 on a WXP machine where Python 2.5 is already installed.
What would be better - Use the Plone install programm which installs a copy of Python 2.4 too or install Plone and Zope manually and let it use Python 2.5 ?

Can't use 2.5, currently

Posted by Ian F. Hood at February 29, 2008 - 17:40
Plone 3 currently uses Zope 2.10.x which is NOT compatible with Python 2.5, so you will need the 2.4 installed

Installing PIL

Posted by Mike Combs at December 15, 2007 - 23:32
If you've never installed a Python library before (like me), here's the short version of the instructions, taken from another Plone tutorial:

http://plone.org/documentation/how-to/basic-install-of-your-own-python-zope-plone-server-on-fedora-core-5

Installation is similar to the above for Python, consisting of un-tarring the file then running configure, make and make install:

tar-zxvf Imaging-1.1.5.tar.gz

cd Imaging-1.1.5

Look at the README file for instructions on compiling and installing but the command will look something like this:

python setup.py install

I think you can verify that PIL is installed correctly by doing this at the command line:

python
>>> import sys
>>> print sys.path

You should see something like /site-packages/PIL at the end of the path.

404 for Cheetah prereq (OS X)?

Posted by John DeStefano at February 5, 2008 - 21:29
I've tried to easy_install ZopeSkel several times on OS X 10.5, and I consistently get a "Not Found" error on the Cheetah templates package, as shown below (also verified manually that the URL is broken):

easy_install -U ZopeSkel
Searching for ZopeSkel
Reading http://pypi.python.org/simple/ZopeSkel/
Best match: ZopeSkel 1.5.1
Processing ZopeSkel-1.5.1-py2.5.egg
ZopeSkel 1.5.1 is already the active version in easy-install.pth

Using /Library/Python/2.5/site-packages/ZopeSkel-1.5.1-py2.5.egg
Processing dependencies for ZopeSkel
Searching for Cheetah
Reading http://pypi.python.org/simple/Cheetah/
Reading http://www.CheetahTemplate.org/
Reading http://sourceforge.net/project/showfiles.php?group_id=28961
Best match: Cheetah 2.0.1
Downloading http://downloads.sourceforge.net/cheetahtemplate/Cheetah-2.0.1.tar.gz?download
error: Can't download http://downloads.sourceforge.net/cheetahtemplate/Cheetah-2.0.1.tar.gz?download: 404 Not Found

working now

Posted by John DeStefano at February 20, 2008 - 14:27
This seems to be fixed, now that the script is using ZopeSkel 1.6, and the Cheetah download is available.

Clarification: about windows installers - especially for newbies

Posted by Ian F. Hood at February 29, 2008 - 18:51
Please note that Enfold contributes win32 installers for both Zope and Plone. They are not the same.

The Plone3 installer sets up all of the system software, creates and installs a zope instance (as a windows service) and creates a ready-to-use Plone Site on port 80 using an access rule. This is great if you need/want a running site ASAP, but NOT if you want to use zc.buildout as described above.

For this tutorial use the Zope installer which does (most of) the software setup for you but not the instance creations. It offers to make an instance but you will want to do that yourself with zc.buildout. The Zope installer, however, misses two critical, but simple, steps: it doesn't set the system PATH and doesn't install the python image library (PIL).

Here's the procedure:

(a) download and install Zope 2.10.x ('no' to create instance)

(b) set PYTHONPATH to the installed ...\Zope\2.10.x\Python
set SOFTWARE_HOME to the installed ...\Zope\2.10.x\Zope
set PASTERPATH to the installed ...\Zope\2.10.x\Python\Scripts
set the system PATH to include these 3 folder paths

(c) register Python with windows (so the PIL installer can find it)
create a text file with 2 lines:
[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.4\InstallPath]
@="C:\\Zope\\2.10.5\\Python"
- where the second line specifies the same folder as PYTHONPATH above
- NOTICE the escaped (double) backslashes are needed too
save the file as temp.reg
- double-click to open/run it (answer 'yes' to add the registry entries)
- delete temp.reg (you're done with it)

(d) download the win32 installer for PIL and run it (it should find the Python you just registered)

At this point you already have easy_install (ez_setup.py is done) so you can continue from:

easy_install -U ZopeSkel

The Python win32 extensions were already installed by Zope.

You only need mingw if/when you write 'C' extensions to Python eggs, otherwise you're golden! (Eggs - get it? Golden eggs? Ok, nevermind.)

Installing Pil On FreeBSD 7

Posted by Gavin Spomer at July 1, 2008 - 17:45
Wow, I'm getting nowhere fast! While running "/usr/local/bin/python2.4 selftest.py" I get "Fatal error 'Cannot allocate red zone for initial thread' at line 384 in file /usr/src/lib/libthr/thread/thr_init.c (errno = 12)" about 100 times. After googling, seems lots of people are having problems getting Pil installed on FreeBSD, but I can't find a solution. Why is Pil needed? (what does imaging have to do with Product installs?) Why is installing Products for Plone 3 so much more complicated? Seems like a step backwards, IMO, but what the heck do I know? ;)

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by