ImportError: No module named i18n.normalizer.interfaces
Today I've found one of those ugly problems that took me some time to resolve. In one of my servers I've a Zope instance that was created using a Zope install from the FreeBSD ports collection (pretty useful if you only need plain Zope, as it was my case). Since I installed such version of Zope, I've added a plone "production" buildout to the same server and everything was running smoothly... until I had to restart my original Zope instance (which, yes, has an old plone site inside too). Zope restarted correctly, but when trying to access the plone site, I got a message about the plone site being broken... wtf?.
I took a look over the event.log file of the Zope instance, and I found this error:
ImportError: No module named i18n.normalizer.interfaces
Pretty strange... but seems I wasn't the first one with this problem. In the end it was a path-related problem, as the python process running Zope was picking up some modules from the site-packages directory, instead of the instance lib/python directory.
Final solution?, easy, I just modified my zopectl script to get something like:
#! /bin/sh PYTHON="/usr/local/bin/python2.4" ZOPE_HOME="/usr/local/www/Zope210" INSTANCE_HOME="/usr/local/www/zope2105" CONFIG_FILE="/usr/local/www/zope2105/etc/zope.conf" SOFTWARE_HOME="/usr/local/www/Zope210/lib/python" PLONE_SOFTWARE_HOME="$INSTANCE_HOME/lib/python" PYTHONPATH="$SOFTWARE_HOME:$PLONE_SOFTWARE_HOME:$PYTHONPATH" export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME ZDCTL="$SOFTWARE_HOME/Zope2/Startup/zopectl.py" exec "$PYTHON" "$ZDCTL" -C "$CONFIG_FILE" "$@"
Setting PLONE_SOFTWARE_HOME and adding it to the PYTHONPATH var.
(of course I should have moved the plone site into the buildout, but that is another story...)