On Jan 19, 8:25 am, Localhost <[EMAIL PROTECTED]> wrote:
> David,
>
>   You need to run the command 'python setup.py develop' (no quotes) in
> the directory: C:\Program Files\Python25\Scripts\helloworld\ since
> Python is unable to find the directory where helloworld is located.
> This should help.

That shouldn't be required as the sys.path.append() done in the WSGI
script file should be sufficient for Python running under mod_wsgi to
find it. In other words, there should not be a need to install a
reference in the site-packages directory.

That said, it has been seen for whatever reason on a couple of
occasions that a brand new application created with paster create just
doesn't want to work and one gets that error. It only happens rarely
and in trying to reproduce the problem it hasn't occurred. One trick
used before was to run paster serve just once for the application and
then it would work okay under mod_wsgi.

So, there is definitely something odd going on whereby something isn't
set up reliably when using virtual environments.

Graham

> On Jan 18, 3:00 pm, David <[EMAIL PROTECTED]> wrote:
>
> > The helloworld app was created by the pylons script.. I forgot what
> > it's called.. that creates new applications. The egg cache directory,
> > to be sure it was writable, has full control given to the Everyone
> > group.
>
> > Here's my wsgi script:
>
> > import os, sys
> > sys.path.append('C:/Program Files/Python25/Scripts/helloworld')
> > os.environ['PYTHON_EGG_CACHE'] = 'C:/Program Files/Python25/egg-cache'
>
> > from paste.deploy import loadapp
>
> > application = loadapp('C:/Program Files/Python25/Scripts/helloworld/
> > development.ini')
>
> > Here's my apache error:
>
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]mod_wsgi
> > (pid=484): Target WSGI script 'C:/Program Files/Python25/Scripts/
> > helloworld/wsgi/myapp.wsgi' cannot be loaded as Python module.
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]mod_wsgi
> > (pid=484): Exception occurred processing WSGI script 'C:/Program Files/
> > Python25/Scripts/helloworld/wsgi/myapp.wsgi'.
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1] Traceback (most
> > recent call last):
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "C:/
> > Program Files/Python25/Scripts/helloworld/wsgi/myapp.wsgi", line 10,
> > in <module>
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     application
> > = loadapp("config:" + APP_CONFIG)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 193, in loadapp
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     return
> > loadobj(APP, uri, name=name, **kw)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 213, in loadobj
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]
> > global_conf=global_conf)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 237, in loadcontext
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]
> > global_conf=global_conf)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 267, in _loadconfig
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     return
> > loader.get_context(object_type, name, global_conf)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 393, in get_context
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     section)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 415, in _context_from_use
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     object_type,
> > name=use, global_conf=global_conf)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 345, in get_context
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]
> > global_conf=global_conf)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 237, in loadcontext
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]
> > global_conf=global_conf)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 274, in _loadegg
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     return
> > loader.get_context(object_type, name, global_conf)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 542, in get_context
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     object_type,
> > name=name)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "c:\
> > \program files\\python25\\lib\\site-packages\\pastedeploy-1.3.1-
> > py2.5.egg\\paste\\deploy\\loadwsgi.py", line 562, in
> > find_egg_entry_point
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]
> > pkg_resources.require(self.spec)
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "C:\
> > \Program Files\\Python25\\lib\\site-packages\\pkg_resources.py", line
> > 626, in require
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     needed =
> > self.resolve(parse_requirements(requirements))
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]   File "C:\
> > \Program Files\\Python25\\lib\\site-packages\\pkg_resources.py", line
> > 524, in resolve
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]     raise
> > DistributionNotFound(req)  # XXX put more info here
> > [Fri Jan 18 14:58:47 2008] [error] [client 127.0.0.1]
> > DistributionNotFound: helloworld
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to