I'm new to mod_wsgi and had a simple question -- I couldn't find this
in the group archives or elsewhere.
I'm getting a simple ImportError -- no module named CherryPy -- when I
try to use the first method cited in this [http://code.google.com/p/
modwsgi/wiki/IntegrationWithTurboGears#whb] article.
{{{
[Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] mod_wsgi
(pid=28107): Target WSGI script '/mnt/local/deploy/tg/apache/tg.wsgi'
cannot be loaded as Python
module.
[Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] mod_wsgi
(pid=28107): Exception occurred within WSGI script '/mnt/local/deploy/
tg/apache/tg.wsgi'.
[Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] Traceback (most
recent call
last):
[Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] File "/mnt/
local/deploy/tg/apache/tg.wsgi", line 18, in <module>
[Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] import
cherrypy
[Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] ImportError: No
module named cherrypy
}}}
My sys.path includes cherrypy:
{{{
['/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/
plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-
dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/
python2.5/site-packages', '/mnt/local/deploy/tg/', '/usr/lib/python2.5/
site-packages/CherryPy-2.2.1-py2.5.egg/cherrypy', '/mnt/local/deploy/
tg/', '/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/
cherrypy/']
}}}
And I'm able to import cherrypy normally from the command line:
{{{
$ python
>>> import cherrypy
>>>
}}}
Any clues on where I might be going wrong?
/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg
in the path. It shouldn't include 'cherrypy' at the end.
Are you adding that into sys.path yourself. By rights you shouldn't
need to if setuptools stuff is all installed correctly as it should
activate when Python startups and automatically add the path itself.
Graham
This path /usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg is
in sys.path if I run python normally from the command line. [See
outdented line below.]
$ python
>>> import sys
>>> sys.path
['', '/usr/lib/python2.5/site-packages/TurboGears-1.0.4b1-py2.5.egg',
'/usr/lib/python2.5/site-packages/SQLObject-0.9.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg',
'/usr/lib/python2.5/site-packages/TurboKid-1.0.3-py2.5.egg',
'/usr/lib/python2.5/site-packages/TurboJson-1.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/TurboCheetah-0.9.5-py2.5.egg',
'/usr/lib/python2.5/site-packages/simplejson-1.7.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2306-py2.5-linux-i686.egg',
'/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg',
'/usr/lib/python2.5/site-packages/FormEncode-0.7.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/DecoratorTools-1.5-py2.5.egg',
'/usr/lib/python2.5/site-packages/configobj-4.4.0-py2.5.egg',
'/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/Cheetah-2.0rc8-py2.5-linux-i686.egg',
'/usr/lib/python2.5/site-packages/kid-0.9.6-py2.5.egg',
'/usr/lib/python2.5/site-packages/PyProtocols-1.0a0dev_r2302-py2.5-linux-i686.egg',
'/usr/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/Paste-1.4.2-py2.5.egg',
'/usr/lib/python2.5/site-packages/Myghty-1.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/Routes-1.7-py2.5.egg',
'/usr/lib/python2.5/site-packages/setuptools-0.6c7-py2.5.egg',
'/usr/lib/python2.5/site-packages/Pylons-0.9.6-py2.5.egg',
'/usr/lib/python2.5/site-packages/buildutils-0.3-py2.5.egg',
'/usr/lib/python2.5/site-packages/pudge-0.1.3-py2.5.egg',
'/usr/lib/python2.5/site-packages/Pygments-0.8.1-py2.5.egg',
'/usr/lib/python2.5/site-packages/elementtree-1.2.6_20050316-py2.5.egg',
'/usr/lib/python2.5/site-packages/docutils-0.4-py2.5.egg',
'/usr/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg',
'/usr/lib/python2.5/site-packages/nose-0.10.0b1-py2.5.egg',
'/usr/lib/python2.5/site-packages/decorator-2.2.0-py2.5.egg',
'/usr/lib/python2.5/site-packages/Beaker-0.7.5-py2.5.egg',
'/usr/lib/python2.5/site-packages/WebHelpers-0.3.2-py2.5.egg',
'/usr/lib/python25.zip', '/usr/lib/python2.5',
'/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
'/usr/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/lib/python2.5/site-packages',
'/var/lib/python-support/python2.5']
So I added a simple debugging statement to my tg.wsgi code:
sys.stdout = sys.stderr
print sys.path
When I examine the error logs, I get a very different starting sys.path:
Apache error.log:
[Wed Sep 26 09:26:00 2007] [error] ['/usr/lib/python25.zip',
'/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2',
'/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/lib/python2.5/site-packages']
I tried manually appending the CherryPy path, in tg.wgsi as:
sys.path.append('/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/')
And this shows up faithfully in the error.log under sys.path
[Wed Sep 26 09:26:00 2007] [error] ['/usr/lib/python25.zip',
'/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2',
'/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
'/usr/lib/python2.5/site-packages','/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/']
But I still hit the ImportError: no module named cherrypy.
If it helps, I've also pasted my tg.wsgi code below:
-------------
import sys
# Taken from http://code.google.com/p/modwsgi/wiki/IntegrationWithTurboGears
# Need to set this path automatically when we move out from the
repository into the build path
sys.path.append('/mnt/local/deploy/tg')
sys.path.append('/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/')
sys.stdout = sys.stderr
print "------"
print sys.path
import os
os.environ['PYTHON_EGG_CACHE'] = '/mnt/local/deploy/tg/eggs/'
import re
import atexit
import cherrypy
import cherrypy._cpwsgi
import turbogears
turbogears.update_config(configfile="dev.cfg", modulename="tg.config")
turbogears.config.update({'global': {'server.environment': 'production'}})
turbogears.config.update({'global': {'autoreload.on': False}})
turbogears.config.update({'global': {'server.log_to_screen': False}})
if cherrypy.server.state == 0:
atexit.register(cherrypy.server.stop)
cherrypy.server.start(init_only=True, server_class=None)
import tg.controllers
cherrypy.root = tg.controllers.Root()
application = cherrypy._cpwsgi.wsgiApp
/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/
Is it an expanded set of directories or is this a packed egg, ie., single file?
What is in:
/mnt/local/deploy/tg/eggs/
ie., what eggs have been unpacked in there.
Does the user Apache runs as have write permission to the egg cache?
Graham
It is an expanded set of directories:
$ ls -al /usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/
total 16
drwxrw-r-x 4 root www-data 4096 Sep 21 22:50 .
drwxrw-r-x 32 root www-data 4096 Sep 26 11:41 ..
drwxrw-r-x 2 root www-data 4096 Sep 21 22:50 EGG-INFO
drwxrw-r-x 6 root www-data 4096 Sep 21 22:50 cherrypy
The Apache user runs as:
User www-data
Group www-data
> What is in:
>
> /mnt/local/deploy/tg/eggs/
Nothing is in this directory -- I thought this was where eggs would be
unpacked at runtime if so needed:
$ ls -al /mnt/local/deploy/tg/eggs
total 8
drwxr-xr-x 2 root www-data 4096 Sep 26 00:58 .
drwxr-xr-x 6 root www-data 4096 Sep 26 00:58 ..
I originally ran into the permissions error -- but after I chown'd -R
root.www-data, that error disappeared and I was left only with the
ImportError.
Thanks,
T.U.
I cant see how it would matter as still o+x, but you don't have g+x on
the directory permissions.
Run:
cd /usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg
find . -type d -print -exec chmod 0775 {} \;
This will ensure that g+x is on all directories under that location.
Also ensure that the .py files in the directory hierarchy are sensible as well.
> The Apache user runs as:
>
> User www-data
> Group www-data
>
> > What is in:
> >
> > /mnt/local/deploy/tg/eggs/
>
> Nothing is in this directory -- I thought this was where eggs would be
> unpacked at runtime if so needed:
>
> $ ls -al /mnt/local/deploy/tg/eggs
>
> total 8
> drwxr-xr-x 2 root www-data 4096 Sep 26 00:58 .
> drwxr-xr-x 6 root www-data 4096 Sep 26 00:58 ..
>
> I originally ran into the permissions error -- but after I chown'd -R
> root.www-data, that error disappeared and I was left only with the
> ImportError.
That shouldn't have been required on the Python site-packages
directory unless the directory permissions were screwed up in the
first place such that they weren't readable to others. In general you
shouldn't be changing ownership of stuff in Python site-packages at
all.
Graham
I'm still getting the same error [from my apache error logs]:
[Wed Oct 17 01:20:18 2007] [error] [client xx.yy.zz.aa] mod_wsgi
(pid=8063): Target WSGI script '/mnt/local/deploy/tg/apache/tg.wsgi'
cannot be loaded as Python module.
[Wed Oct 17 01:20:18 2007] [error] [client xx.yy.zz.aa] mod_wsgi
(pid=8063): Exception occurred within WSGI script
'/mnt/local/deploy/tg/apache/tg.wsgi'.
[Wed Oct 17 01:20:18 2007] [error] [client xx.yy.zz.aa] Traceback
(most recent call last):
[Wed Oct 17 01:20:18 2007] [error] [client xx.yy.zz.aa] File
"/mnt/local/deploy/tg/apache/tg.wsgi", line 18, in <module>
[Wed Oct 17 01:20:18 2007] [error] [client xx.yy.zz.aa] import
cherrypy
[Wed Oct 17 01:20:18 2007] [error] [client xx.yy.zz.aa] ImportError:
No module named cherrypy
The permissions on the directory /mnt/local/deploy/tg/eggs:
drwxr-xr-x 2 root www-data 4096 Oct 17 00:52 eggs
The permissions on the directory /mnt/local/deploy/tg/apache:
drwxr-xr-x 2 root www-data 4096 Oct 17 01:03 apache
And on the cherryPy directory:
drwxrw-r-x 4 root www-data 4096 Sep 21 22:50 CherryPy-2.2.1-py2.5.egg
Thanks again - seems pretty simple, but I can't seem to track it down,
so I appreciate your help!
However, I implemented this suggestion in the CherryPy dir:
$ find . -type d -print -exec chmod 0775 {} \;
$ ls -al
drwxrwxr-x 4 root www-data 4096 Sep 21 22:50 .
drwxrw-r-x 32 root www-data 4096 Sep 28 17:49 ..
drwxrwxr-x 2 root www-data 4096 Sep 21 22:50 EGG-INFO
drwxrwxr-x 6 root www-data 4096 Sep 21 22:50 cherrypy
but I'm still getting the same permissions error:
[Wed Oct 17 01:36:38 2007] [error] [client xx.yy.zz.aa] File "/mnt/
local/deploy/tg/apache/tg.wsgi", line 20, in <module>
[Wed Oct 17 01:36:38 2007] [error] [client xx.yy.zz.aa] import
cherrypy
[Wed Oct 17 01:36:38 2007] [error] [client xx.yy.zz.aa] ImportError:
No module named cherrypy
Thanks - and apologies for missing your earlier post.
> > On 9/26/07, Graham Dumpleton <graham.dumple...@gmail.com> wrote:
>
> > > What is in:
>
> > > /usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/
>
> > > Is it an expanded set of directories or is this a packed egg, ie., single file?
>
> > > What is in:
>
> > > /mnt/local/deploy/tg/eggs/
>
> > > ie., what eggs have been unpacked in there.
>
> > > Does the user Apache runs as have write permission to the egg cache?
>
> > > Graham
>
> > > On 27/09/2007, Tiger Uppercut <get2thachop...@gmail.com> wrote:
>
> > > > Thanks, and apologies that I can't put the code snippets in WikiFormatting.
>
> > > > This path /usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg is
> > > > in sys.path if I run python normally from the command line. [See
> > > > outdented line below.]
>
> > > > $ python
> > > > >>> import sys
> > > > >>> sys.path
>
> > > > ['', '/usr/lib/python2.5/site-packages/TurboGears-1.0.4b1-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/SQLObject-0.9.1-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/TurboKid-1.0.3-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/TurboJson-1.1-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/TurboCheetah-0.9.5-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/simplejson-1.7.1-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2306-py2.5-linux- i686.egg',
> > > > '/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/FormEncode-0.7.1-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/DecoratorTools-1.5-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/configobj-4.4.0-py2.5.egg',
>
> > > > '/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg',
>
> > > > '/usr/lib/python2.5/site-packages/Cheetah-2.0rc8-py2.5-linux-i686.egg',
> > > > '/usr/lib/python2.5/site-packages/kid-0.9.6-py2.5.egg',
> > > > '/usr/lib/python2.5/site-packages/PyProtocols-1.0a0dev_r2302-py2.5-linux-i6 86.egg',
> > > > # Taken fromhttp://code.google.com/p/modwsgi/wiki/IntegrationWithTurboGears
>
> > > > # Need to set this path automatically when we move out from the
> > > > repository into the build path
> > > > sys.path.append('/mnt/local/deploy/tg')
> > > > sys.path.append('/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg/ ')
>
> > > > sys.stdout = sys.stderr
> > > > print "------"
> > > > print sys.path
> > > > import os
> > > > os.environ['PYTHON_EGG_CACHE'] = '/mnt/local/deploy/tg/eggs/'
>
> > > > import re
> > > > import atexit
> > > > import cherrypy
> > > > import cherrypy._cpwsgi
> > > > import turbogears
>
> > > > turbogears.update_config(configfile="dev.cfg", modulename="tg.config")
> > > > turbogears.config.update({'global': {'server.environment': 'production'}})
> > > > turbogears.config.update({'global': {'autoreload.on': False}})
> > > > turbogears.config.update({'global': {'server.log_to_screen': False}})
>
> > > > if cherrypy.server.state == 0:
> > > > atexit.register(cherrypy.server.stop)
> > > > cherrypy.server.start(init_only=True, server_class=None)
>
> > > > import tg.controllers
>
> > > > cherrypy.root = tg.controllers.Root()
>
> > > > application = cherrypy._cpwsgi.wsgiApp
>
> > > > On 9/26/07, Graham Dumpleton <graham.dumple...@gmail.com> wrote:
>
> > > > > It should only use:
>
> > > > > /usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg
>
> > > > > in the path. It shouldn't include 'cherrypy' at the end.
>
> > > > > Are you adding that into sys.path yourself. By rights you shouldn't
> > > > > need to if setuptools stuff is all installed correctly as it should
> > > > > activate when Python startups and automatically add the path itself.
>
> > > > > Graham
>
> > > > > On 26/09/2007, Tiger Uppercut <get2thachop...@gmail.com> wrote:
>
> > > > > > Hi,
>
> > > > > > I'm new to mod_wsgi and had a simple question -- I couldn't find this
> > > > > > in the group archives or elsewhere.
>
> > > > > > I'm getting a simple ImportError -- no module named CherryPy -- when I
> > > > > > try to use the first method cited in this [http://code.google.com/p/
> > > > > > modwsgi/wiki/IntegrationWithTurboGears#whb] article.
>
> > > > > > {{{
>
> > > > > > [Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] mod_wsgi
> > > > > > (pid=28107): Target WSGI script '/mnt/local/deploy/tg/apache/tg.wsgi'
> > > > > > cannot be loaded as Python
> > > > > > module.
> > > > > > [Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] mod_wsgi
> > > > > > (pid=28107): Exception occurred within WSGI script '/mnt/local/deploy/
> > > > > > tg/apache/tg.wsgi'.
> > > > > > [Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] Traceback (most
> > > > > > recent call
> > > > > > last):
> > > > > > [Wed Sep 26 02:02:05 2007] [error] [client xx.xx.xx.x] File "/mnt/
> > > > > > local/deploy/tg/apache/tg.wsgi", line 18, in <module>
>
> ...
>
> read more »
cd /usr/lib/python2.5/site-packages
ls -lasg
Post the output.
Also do:
cat setuptools.pth
and post the output.
Your site-packages directory must be screwed up in some way, with
permissions wrong such that Apache user can read something important.
The only other possibility is that you have SELinux extensions enabled
and it is stuffing things up.
Graham
Also the output of:
cat easy-install.pth
Graham
> > > > > > ['', '/usr/lib/python2.5/site-packages/TurboGears- 1.0.4b1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/SQLObject-0.9.1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg ',
> > > > > > '/usr/lib/python2.5/site-packages/TurboKid-1.0.3-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/TurboJson-1.1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/TurboCheetah- 0.9.5-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/simplejson-1.7.1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/RuleDispatch-0.5a0.dev_r2306-py2.5-linux- i686.egg',
> > > > > > '/usr/lib/python2.5/site-packages/PasteScript-1.3.6-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/FormEncode-0.7.1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/DecoratorTools-1.5-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/configobj-4.4.0-py2.5.egg',
> > >
> > > > > > '/usr/lib/python2.5/site-packages/CherryPy-2.2.1-py2.5.egg',
> > >
> > > > > > '/usr/lib/python2.5/site-packages/Cheetah-2.0rc8-py2.5-linux-i686.egg ',
> > > > > > '/usr/lib/python2.5/site-packages/kid-0.9.6-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/PyProtocols-1.0a0dev_r2302-py2.5-linux-i6 86.egg ',
> > > > > > '/usr/lib/python2.5/site-packages/PasteDeploy-1.3.1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/Paste-1.4.2-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/Myghty- 1.1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/Routes-1.7-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/setuptools-0.6c7-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/Pylons-0.9.6-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/buildutils-0.3-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/pudge- 0.1.3-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/Pygments-0.8.1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/elementtree-1.2.6_20050316-py2.5.egg ',
> > > > > > '/usr/lib/python2.5/site-packages/docutils-0.4-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/Mako-0.1.8-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/nose- 0.10.0b1-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/decorator-2.2.0-py2.5.egg',
> > > > > > '/usr/lib/python2.5/site-packages/Beaker-0.7.5-py2.5.egg ',
> > > > > > '/usr/lib/python2.5/site-packages/WebHelpers-0.3.2-py2.5.egg',
> > > > > > '/usr/lib/python25.zip', '/usr/lib/python2.5',
> > > > > > '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk',
> > > > > > '/usr/lib/python2.5/lib-dynload',
> > > > > > '/usr/local/lib/python2.5/site-packages',
> > > > > > '/usr/lib/python2.5/site-packages',
> > > > > > '/var/lib/python-support/python2.5']
> > >
> > > > > > So I added a simple debugging statement to my tg.wsgi code:
> > >
> > > > > > sys.stdout = sys.stderr
> > > > > > print sys.path
> > >
> > > > > > When I examine the error logs, I get a very different starting sys.path:
> > >
> > > > > > Apache error.log:
> > >
> > > > > > [Wed Sep 26 09:26:00 2007] [error] ['/usr/lib/python25.zip',
> > > > > > '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2',
> > > > > > '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload',
> > > > > > '/usr/local/lib/python2.5/site-packages',
> > > > > > '/usr/lib/python2.5/site-packages']
> > >
> > > > > > I tried manually appending the CherryPy path, in tg.wgsi as:
> > >
> > > > > > sys.path.append('/usr/lib/python2.5/site-packages/CherryPy- 2.2.1-py2.5.egg/ ')
> > >
> > > > > > And this shows up faithfully in the error.log under sys.path
> > >
> > > > > > [Wed Sep 26 09:26:00 2007] [error] ['/usr/lib/python25.zip',
> > > > > > '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2',
> > > > > > '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload',
> > > > > > '/usr/local/lib/python2.5/site-packages',
> > > > > > '/usr/lib/python2.5/site-packages','/usr/lib/python2.5/site-packages/Cherry Py-2.2.1-py2.5.egg/']
> > >
> > > > > > But I still hit the ImportError: no module named cherrypy.
> > >
> > > > > > If it helps, I've also pasted my tg.wsgi code below:
> > >
> > > > > > -------------
> > >
> > > > > > import sys
> > > > > > # Taken fromhttp://code.google.com/p/modwsgi/wiki/IntegrationWithTurboGears
> > >
> > > > > > # Need to set this path automatically when we move out from the
> > > > > > repository into the build path
> > > > > > sys.path.append ('/mnt/local/deploy/tg')
BTW, are you setting PYTHON_EGG_CACHE environment variable in WSGI
script file as described in documentation for mod_wsgi? This would be
needed as some of your eggs aren't unpacked. The directory you denote
by the variable must be writable to the Apache user.
Graham
> ...
>
> [Message clipped]