Does this help?
http://stackoverflow.com/questions/6525243/how-to-modify-pythonpath-for-a-wsgi-application-in-alwaysdata-net
else you can set PYTHON_PATH as an environment variable and append
/path/to/web2py there.
On Sunday, 13 January 2013 03:46:41 UTC-6, Daniel Gonzalez wrote:
>
> Hi,
>
> As part of my library, I have a module which I use to wrap some web2py
> components. Let's say I have simple.py:
>
> from gluon.html import B
>
> def my_b(txt):
> return B(txt)
>
> To successfully import this module, my pwd needs to be the directory where
> web2py is installed. Otherwise I get the following error:
>
> >>> import web2pys.simple
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/my/modules/web2pys/simple.py", line 1, in <module>
> from gluon.html import B
> ImportError: No module named gluon.html
>
> This means that my application is running fine whenever I run it with with
> built in Rockett server (python web2py.py), but serving with apache via
> mod_wsgi does not work. I set the python path in mod_wsgi, so that my
> modules can be found:
>
> WSGIDaemonProcess web2py-https user=www-data group=www-data display-name
> =%{GROUP} python-path=/my/modules
>
> But no idea how make gluon accessible to mod_wsgi.
>
> How can I "install" web2py in my system, so that gluon components can be
> imported normally, like any other python package?
>
> Thanks,
> Daniel
>
--