I don't know if you have managed to sort your problem as yet. But I've
got a suggestion...
I'm working locally with Web.py on GAE and I get the same problem if I
use:
  *sys.path.append(path)
The problem goes away if I use:
  *sys.path.insert(0,path)

#comment; I not 100% sure why the later works, but I assume it's
because "sys.path.insert(0,path)" inserts your libs before
'everything' loads while "sys.path.append(path)" puts your libs
'later' after everything has loaded (which is late and the first
loaded modules trow that error because Python has 'not yet' reached/
loaded their path).

On May 1, 3:34 am, Wayne <[email protected]> wrote:
> I'm not sure if this is the right place to ask since it may be more of
> a Python or Dreamhost issue.  I have been working to setup webpy and
> FastCGI on Dreamhost with some success.  When I replaced my test
> script with one that imported webpy things went wierd.  If I run
> Python interactively I can import sys, use sys.path.append to update
> my path and then import web.  When I run the script I get an error
> that the web module cannot be found.
>
> The code I am running is:
>
> #!/usr/bin/python2.5
>
> import sys
> sys.path.append('/home/account/py_libs')
>
> import web
>
> urls = ("/(.*)", "index")
> app = web.application(urls, globals())
>
> class index:
>     def GET(self, path=None):
>         return 'Test'
>
> web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func,
> addr)
>
> if __name__ == "__main__":
>     app.run()
>
> *****
> When I run the script from a shell I also get the same message.  I
> have experimented with different ways to append the path (single
> quotes, double quotes, with a trailing slash, without, etc.) and it
> does no good.  All of the things that fail in the script work when
> typing the same command interactively.
>
> Has anyone else encountered this before?  If you have any suggestions
> they would be greatly appreciated.
>
> For now I have copied the webpy directory into the root of my server
> since this is not public yet.  With the webpy directory in the
> DocumentRoot everything works as expected.
>
> Thanks for any help,
>
> Wayne
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web.py" 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 
> athttp://groups.google.com/group/webpy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to