Hi, I resolved a similar problem. In my case, the error was related with different python versions: 2.6 and 2.7. I replaced a first line "#!/usr/bin/env python" to "#!/usr/bin/env python2.7" in a base script (for you it is /var/www/webpy-app/borg/src/app.py). Possible, it will help you.
четверг, 31 января 2013 г., 8:43:49 UTC+4 пользователь Pradeep Banavara написал: > > I posted this on SO earlier but couldn't get any responses. Hoping that > you guys can perhaps help out. > > Environment : Pymongo + mod_wsgi + web.py + apache2 ( mod_wsgi in embedded > mode ). > > Exception : > > [Wed Jan 30 11:40:28 2013] [error] [client 111.93.158.52] mod_wsgi > (pid=27117): Target WSGI script '/var/www/webpy-app/borg/src/app.py' cannot > be loaded as Python module.[Wed Jan 30 11:40:28 2013] [error] [client > 111.93.158.52] mod_wsgi (pid=27117): Exception occurred processing WSGI > script '/var/www/webpy-app/borg/src/ap > p.py'.[Wed Jan 30 11:40:28 2013] [error] [client 111.93.158.52] Traceback > (most recent call last):[Wed Jan 30 11:40:28 2013] [error] [client > 111.93.158.52] File "/var/www/webpy-app/borg/src/app.py", line 1, in > <module>[Wed Jan 30 11:40:28 2013] [error] [client 111.93.158.52] import > web,json,csv,pymongo,pdb,sys[Wed Jan 30 11:40:28 2013] [error] [client > 111.93.158.52] File > "/opt/python2.7/lib/python2.7/site-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/pymongo > /__init__.py", line 61, in <module>[Wed Jan 30 11:40:28 2013] [error] [client > 111.93.158.52] File > "/opt/python2.7/lib/python2.7/site-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/pymongo > /connection.py", line 39, in <module>[Wed Jan 30 11:40:28 2013] [error] > [client 111.93.158.52] File > "/opt/python2.7/lib/python2.7/site-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/pymongo > /mongo_client.py", line 44, in <module>[Wed Jan 30 11:40:28 2013] [error] > [client 111.93.158.52] File > "/opt/python2.7/lib/python2.7/site-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/bson/__ > init__.py", line 41, in <module>[Wed Jan 30 11:40:28 2013] [error] [client > 111.93.158.52] File > "/opt/python2.7/lib/python2.7/site-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/bson/_c > bson.py", line 7, in <module>[Wed Jan 30 11:40:28 2013] [error] [client > 111.93.158.52] File > "/opt/python2.7/lib/python2.7/site-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/bson/_c > bson.py", line 6, in __bootstrap__[Wed Jan 30 11:40:28 2013] [error] [client > 111.93.158.52] AttributeError: PyCapsule_Import "datetime.datetime_CAPI" is > not valid > > > I suspect this is some kind of library mismatch. mod_wsgi might be looking > at the python 2.6 libraries. Any clue how to fix the library path ? here's > my httpd.conf > > LoadModule wsgi_module modules/mod_wsgi.soWSGIScriptAlias /borg > /var/www/webpy-app/borg/src/app.py/WSGIPythonPath > /opt/python2.7/lib/python2.7/site-packages/Alias /borg/static > /var/www/webpy-app/borg/src/static/AddType text/html .py > <Directory /var/www/webpy-app/> > Order deny,allow > Allow from all</Directory> > > Any help will be greatly appreciated. > > -- You received this message because you are subscribed to the Google Groups "web.py" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/webpy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
