Personal tools
You are here: Home Documentation How-tos How to hack your Zope 2 instance so that you can install Python packages using easy_install
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

How to hack your Zope 2 instance so that you can install Python packages using easy_install

This How-to applies to: Any version.
This How-to is intended for: Server Administrators

This HOWTO guides you through the few steps required to make your Zope 2 instance on Unix/Linux/Mac OSX a full-blown Python environment where you can install Python packages without administrator rights, using the convenient EasyInstall tool.

This HOWTO guides you through the few steps required to make your Zope 2 instance on Unix/Linux/Mac OSX a full-blown Python environment where you can install Python packages without administrator rights, using the convenient EasyInstall tool.

All literal blocks in this HOWTO are meant to be entered into a shell command line, the $ indicates the prompt.

Let's assume your Zope instance lives here:

$ INSTANCE_HOME=/var/lib/zope/myinstance

You need to get workingenv, and make your instance a working environment:

$ easy_install workingenv.py
$ workingenv $INSTANCE_HOME --home

Add a line just before the last line in the files $INSTANCE_HOME/bin/zopectl and $INSTANCE_HOME/bin/runzope, so that the last two lines read something like:

. $INSTANCE_HOME/bin/activate
exec "$PYTHON" "$ZDCTL" -C "$CONFIG_FILE" "$@"

Make sure you do this in both zopectl and runzope! Now whenever Zope restarts, it will use our new Python environment.

You can now easy install packages into your Zope instance:

$ . $INSTANCE_HOME/bin/activate
$ easy_install elementtree

This example will download and install elementtree into your Zope instance.  You can also download and install packages using the usual python setup.py install and they'll install only in your Zope's environment.

Whenever you want to deactivate your Python environment, type

$ deactivate
by Daniel Nouri last modified April 26, 2007 - 01:59 All content is copyright Plone Foundation and the individual contributors.

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