Distribution not found error

503 views
Skip to first unread message

Artur Daschevici

unread,
Feb 15, 2012, 5:43:10 PM2/15/12
to pylons-discuss
This is the stacktrace i am getting:

mod_wsgi (pid=5140): Target WSGI script 'H:/aaa/testsite/apache/
handler.wsgi' cannot be loaded as Python module.
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] mod_wsgi
(pid=5140): Exception occurred processing WSGI script 'H:/aaa/testsite/
apache/handler.wsgi'.
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "H:/aaa/
testsite/apache/handler.wsgi", line 13, in <module>
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] application
= loadapp('config:h:/aaa/testsite/development.ini')
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 247, in loadapp
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] return
loadobj(APP, uri, name=name, **kw)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 271, in loadobj
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1]
global_conf=global_conf)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 296, in loadcontext
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1]
global_conf=global_conf)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 320, in _loadconfig
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] return
loader.get_context(object_type, name, global_conf)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 454, in get_context
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] section)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 476, in _context_from_use
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] object_type,
name=use, global_conf=global_conf)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 406, in get_context
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1]
global_conf=global_conf)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 296, in loadcontext
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1]
global_conf=global_conf)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 328, in _loadegg
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] return
loader.get_context(object_type, name, global_conf)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 620, in get_context
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] object_type,
name=name)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "C:\
\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg\\paste\\deploy
\\loadwsgi.py", line 640, in find_egg_entry_point
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1]
pkg_resources.require(self.spec)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "build\
\bdist.win32\\egg\\pkg_resources.py", line 654, in require
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] needed =
self.resolve(parse_requirements(requirements))
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] File "build\
\bdist.win32\\egg\\pkg_resources.py", line 552, in resolve
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1] raise
DistributionNotFound(req)
[Thu Feb 16 00:34:55 2012] [error] [client 127.0.0.1]
DistributionNotFound: testsite

My guess is that somehow the server is not loading the correct
packages as C:\\Python\\lib\\site-packages\\pastedeploy-1.5.0-py2.6.egg
\\paste\\deploy\\loadwsgi.py is the path to my global python install.

Running from the virtual env paster works.
Running the wsgi handler also works.

Reinstalled the virtual env from scratch - still didn't work. This is
the basic hello world app for testing.

Another piece of info...may help: when I installed the first time
without a virtual environment i made another test app then configured
the environment then ran it from apache and it worked. After that only
failed attempts.
Any help...ideas would be appreciated.
I am running win 7 x64. virtualenv created with py 2.6.6.

Jonathan Vanasco

unread,
Feb 15, 2012, 5:52:37 PM2/15/12
to pylons-discuss
did you run `setup.py develop` ?

Artur Daschevici

unread,
Feb 15, 2012, 6:01:35 PM2/15/12
to pylons-discuss
Yes. Same outcome.

This is my handler.wsgi

import os, sys
from paste.deploy import loadapp
sys.path.append('h:/aaa/testsite')
#sys.path.append('g:/testsite/Lib/site-packages')
#import site
#site.addsitedir('/home/simplesite/env/lib/python2.5/site-packages')
#site.addsitedir('g:/testsite/Lib/site-packages')

os.environ['PYTHON_EGG_CACHE'] = 'h:/aaa/testsite/python-eggs'

#from paste.deploy import loadapp

application = loadapp('config:h:/aaa/testsite/development.ini')

Tried also adding the site-packages to path and without. No luck.

Artur Daschevici

unread,
Feb 18, 2012, 12:55:03 AM2/18/12
to pylons-discuss
Does anyone else have any other ideas...or any ideas on how to debug
this better?

At this point i would pretty much try anything new...well maybe short
of reinstalling everything from python up.

Gael Pasgrimaud

unread,
Feb 18, 2012, 4:05:32 AM2/18/12
to pylons-...@googlegroups.com
On Sat, Feb 18, 2012 at 6:55 AM, Artur Daschevici
<a.dasc...@gmail.com> wrote:
> Does anyone else have any other ideas...or any ideas on how to debug
> this better?
>

Have you tried with the activate_this.py script ?

http://pypi.python.org/pypi/virtualenv#using-virtualenv-without-bin-python

> At this point i would pretty much try anything new...well maybe short
> of reinstalling everything from python up.

Your .wsgi is a python script so you can run:
C:\\Python\\Scripts\\Python.exe handler.wsgi
If you have no traceback then it should work with mod_wsgi too.
Add some print statements for debuging. Like print sys.path or import testsite

>
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
>

Artur Daschevici

unread,
Feb 20, 2012, 4:39:56 PM2/20/12
to pylons-discuss
I managed to get somwhere...at least to get something usable to go on.
Seems that i set up previous versions of pylons on apache and that was
what was breaking my software. The discrepancy between the libs in my
virtual env and the lisb in my python install.

On Feb 18, 11:05 am, Gael Pasgrimaud <g...@gawel.org> wrote:
> On Sat, Feb 18, 2012 at 6:55 AM, Artur Daschevici
>
> <a.daschev...@gmail.com> wrote:
> > Does anyone else have any other ideas...or any ideas on how to debug
> > this better?
>
> Have you tried with the activate_this.py script ?
>
> http://pypi.python.org/pypi/virtualenv#using-virtualenv-without-bin-p...

Artur Daschevici

unread,
Feb 20, 2012, 4:40:19 PM2/20/12
to pylons-discuss
Thanks all for the answers.

On Feb 18, 11:05 am, Gael Pasgrimaud <g...@gawel.org> wrote:
> On Sat, Feb 18, 2012 at 6:55 AM, Artur Daschevici
>
> <a.daschev...@gmail.com> wrote:
> > Does anyone else have any other ideas...or any ideas on how to debug
> > this better?
>
> Have you tried with the activate_this.py script ?
>
> http://pypi.python.org/pypi/virtualenv#using-virtualenv-without-bin-p...
Reply all
Reply to author
Forward
0 new messages