How Do I Install Python Modules To The Unified Installer?
Plone's "Unified Installer" installation script compiles its own copy of Python, because many systems do not include an appropriate version. This can create a bit of confusion you want to install additional Python modules for this copy of Python. Here's how to sort it out.
Just add the name of the eggs you want to the eggs section of the [buildout] part in your buildout.cfg file and run bin/buildout. It's also good to specify a version number. Example, to add python-ldap:
[buildout] ... eggs = Plone python-ldap==2.3.10
Working manually with the Python installation provided by the Unified Installer
The easiest way to work with a particular Python for a particular Plone installation is to put that Python first on your PATH:
$ export PATH=/opt/Plone-3.0.4/Python-2.4.4/bin:$PATH $ which python /opt/Plone-3.0.4/Python-2.4.4/bin/python
Note that this example is for Plone 3, which runs on Python 2.4. Plone 4 runs on Python 2.6 so, if you're using Plone 4, replace all references to Python 2.4 above and below to Python 2.6.
For python-ldap you should then be able to to:
$ python setup.py install
Note that this is basically the same as this:
$ /opt/Plone-3.0.4/Python-2.4.4/bin/python setup.py install
But manipulating your PATH environment variable just saves you a lot of typing. You can also create aliases in your shell profile (~/.bashrc on linux, ~/.profile on Mac OS X) to make it easier to put a particular Python first on your PATH:
# in your .bashrc or .profile alias py4prod="export PATH=/opt/Plone-3.0.4/Python-2.4.4/bin:$PATH" alias py4dev="export PATH=/opt/Plone-3.1/Python-2.4.4/bin:$PATH"
Then on your shell just type:
$ py4prod $ echo $PATH $ /opt/Plone-3.0.4/Python-2.4.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
This FAQ is reproduced from a forum message by Kevin Teague. Thanks, Kevin, for all your great, detailed explaining!