I'm having an installation problem and wondering if other people have
seen the same thing. I have a CentOS 5.1 box with Python 2.4 and
several easy_installs:

easy_install Pygments
easy_install Genshi
easy_install Trac
easy_install doc_utils
easy_install pytz

>From a Python prompt, I can import trac and genshi just fine:

Python 2.4.3 (#1, Mar 14 2007, 18:51:08)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
>>> import trac
>>> import trac.web
>>> import genshi
>>> import genshi.core

I can run my trac instance with "tracd --port 8000 /path/to/project"
and browse it.

BUT I cannot run from Apache 2.2.3 + mod_python 3.2.8 because genshi
cannot by imported:

Mod_python error: "PythonHandler trac.web.modpython_frontend"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
287, in HandlerDispatch
    log=debug)

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
464, in import_module
    module = imp.load_module(mname, f, p, d)

  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/
web/__init__.py", line 1, in ?
    from trac.web.api import *

  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/
web/api.py", line 29, in ?
    from trac.util import get_last_traceback

  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/
util/__init__.py", line 33, in ?
    from trac.util.html import escape, unescape, Markup, Deuglifier

  File "/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/
util/html.py", line 16, in ?
    from genshi import Markup, escape, unescape

ImportError: No module named genshi


Okay, so I checked my mpinfo:

<Location /mpinfo>
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler mod_python.testhandler
</Location>

And it says my path is merely:

/mpinfo/
/usr/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg
/usr/lib/python2.4/site-packages/Pygments-0.9-py2.4.egg
/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg
/usr/lib/python2.4/site-packages/docutils-0.4-py2.4.egg
/usr/lib/python24.zip
/usr/lib/python2.4
/usr/lib/python2.4/plat-linux2
/usr/lib/python2.4/lib-tk
/usr/lib/python2.4/lib-dynload
/usr/lib/python2.4/site-packages
/usr/lib/python2.4/site-packages/Numeric
/usr/lib/python2.4/site-packages/gtk-2.0

But if go back to the Python prompt and print sys.path one per line I
get more eggs including Genshi:

/usr/lib/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-
i686.egg
/usr/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg
/usr/lib/python2.4/site-packages/Pygments-0.9-py2.4.egg
/usr/lib/python2.4/site-packages/Genshi-0.4.4-py2.4.egg
/usr/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg
/usr/lib/python2.4/site-packages/docutils-0.4-py2.4.egg
/usr/lib/python2.4/site-packages/pytz-2007k-py2.4.egg
/usr/lib/python24.zip
/usr/lib/python2.4
/usr/lib/python2.4/plat-linux2
/usr/lib/python2.4/lib-tk
/usr/lib/python2.4/lib-dynload
/usr/lib/python2.4/site-packages
/usr/lib/python2.4/site-packages/Numeric
/usr/lib/python2.4/site-packages/gtk-2.0

So some packages like Pygments-0.9-py2.4.egg are included by
mod_python and others like Genshi-0.4.4-py2.4.egg and
MySQL_python-1.2.2-py2.4-linux-i686.egg are mysteriously absent.
Permissions and ownership look fine.

After going through them I realize that mod_python is only picking
up .egg's that are *directories* and skipping those that are *files*.
Taking a hint from Trac, I added:

PythonPath "sys.path + ['/usr/lib/python2.4/site-packages/Genshi-0.4.4-
py2.4.egg']"

that gets it into the sys.path shown by mpinfo, but I still get the
same exception (yes I added PythonPath to the Trac project location).

I'll ask the mod_python folks about this too, but has anyone else seen
this problem? Any ideas how to convince mod_python that it can import
what command line python imports?

-Chuck

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to