I am receiving this error in the Apache log file when I try to access
http://localhost/trac/
mod_wsgi (pid=1212): Target WSGI script 'C:/projects/cbs/wsgi/
cbs.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=1212): Exception occurred processing WSGI script 'C:/
projects/cbs/wsgi/cbs.wsgi'.
Traceback (most recent call last):
File "C:/projects/cbs/wsgi/cbs.wsgi", line 6, in <module>
import trac.web.main
File "c:\\python\\python26\\lib\\site-packages\\Trac-0.11.3-py2.6.egg
\\trac\\web\\__init__.py", line 12, in <module>
from trac.web.api import *
File "c:\\python\\python26\\lib\\site-packages\\Trac-0.11.3-py2.6.egg
\\trac\\web\\api.py", line 17, in <module>
from BaseHTTPServer import BaseHTTPRequestHandler
File "C:\\python\\python26\\lib\\BaseHTTPServer.py", line 75, in
<module>
import socket # For gethostbyaddr()
File "C:\\python\\python26\\lib\\socket.py", line 46, in <module>
import _socket
ImportError: DLL load failed: The specified module could not be found.
Trac works when I use the standalone server (tracd).
I'm using:
Python 2.6 (latest)
PostgreSQL 8.3 (latest)
psycopg2
mod_wsgi (which seems to work when I use the example script, apache
seems to be configured correctly)
Apache 2.2 (latest)
> I am receiving this error in the Apache log file when I try to accesshttp://localhost/trac/
> mod_wsgi(pid=1212): Target WSGI script 'C:/projects/cbs/wsgi/
> cbs.wsgi' cannot be loaded as Python module.mod_wsgi(pid=1212): Exception occurred processing WSGI script 'C:/
> projects/cbs/wsgi/cbs.wsgi'.
> Traceback (most recent call last):
> File "C:/projects/cbs/wsgi/cbs.wsgi", line 6, in <module>
> import trac.web.main
> File "c:\\python\\python26\\lib\\site-packages\\Trac-0.11.3-py2.6.egg
> \\trac\\web\\__init__.py", line 12, in <module>
> from trac.web.api import *
> File "c:\\python\\python26\\lib\\site-packages\\Trac-0.11.3-py2.6.egg
> \\trac\\web\\api.py", line 17, in <module>
> from BaseHTTPServer import BaseHTTPRequestHandler
> File "C:\\python\\python26\\lib\\BaseHTTPServer.py", line 75, in
> <module>
> import socket # For gethostbyaddr()
> File "C:\\python\\python26\\lib\\socket.py", line 46, in <module>
> import _socket
> ImportError: DLL load failed: The specified module could not be found.
> Trac works when I use the standalone server (tracd).
> I'm using:
> Python 2.6 (latest)
> PostgreSQL 8.3 (latest)
> psycopg2mod_wsgi(which seems to work when I use the example script, apache
> seems to be configured correctly)
> Apache 2.2 (latest)
> Can anybody give me a hand?
In your WSGI hello world example script add:
import socket
Then you will find it probably fails.
Then replace that with:
import sys
print >> sys.stderr, sys.path
Look in the Apache error log for what sys.path is dumped out as.
Then search your system for file called '_socket.so'. Presuming that
is Python modules still have .so extension on Windows, can't remember.
If that directory isn't in sys.path, then likely that your Python
module search path is screwed, possibly because of broken Windows
registry entries.
Post results of what you get for sys.path and where the _socket
extension module is located.
You are correct, adding "import socket" causes an error.
This is what I get from printing the sys.path (formatted for easier
reading):
['C:\\\\python\\\\python26\\\\lib\\\\site-packages\\\\genshi-0.5.1-
py2.6.egg',
'C:\\\\WINDOWS\\\\system32\\\\python26.zip',
'C:\\\\python\\\\python26\\\\Lib',
'C:\\\\python\\\\python26\\\\DLLs',
'C:\\\\python\\\\python26\\\\Lib\\\\lib-tk',
'C:\\\\Program Files\\\\Apache Software Foundation\\\\Apache2.2',
'C:\\\\Program Files\\\\Apache Software Foundation\\\\Apache2.2\\\
\bin',
'C:\\\\python\\\\python26',
'C:\\\\python\\\\python26\\\\lib\\\\site-packages']
I found _socket.pyd in the c:\python\python26\dlls folder.
I looked in the registry and in the PythonPath it includes the same
folders except for the Apache folders.
Any more ideas?
I'm thinking of starting over with Python 2.5...
On Mar 31, 5:47 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
wrote:
> On Mar 31, 10:44 pm, BA <brend...@gmail.com> wrote:
> > Hello:
> > I am receiving this error in the Apache log file when I try to accesshttp://localhost/trac/
> > mod_wsgi(pid=1212): Target WSGI script 'C:/projects/cbs/wsgi/
> > cbs.wsgi' cannot be loaded as Python module.mod_wsgi(pid=1212): Exception occurred processing WSGI script 'C:/
> > projects/cbs/wsgi/cbs.wsgi'.
> > Traceback (most recent call last):
> > File "C:/projects/cbs/wsgi/cbs.wsgi", line 6, in <module>
> > import trac.web.main
> > File "c:\\python\\python26\\lib\\site-packages\\Trac-0.11.3-py2.6.egg
> > \\trac\\web\\__init__.py", line 12, in <module>
> > from trac.web.api import *
> > File "c:\\python\\python26\\lib\\site-packages\\Trac-0.11.3-py2.6.egg
> > \\trac\\web\\api.py", line 17, in <module>
> > from BaseHTTPServer import BaseHTTPRequestHandler
> > File "C:\\python\\python26\\lib\\BaseHTTPServer.py", line 75, in
> > <module>
> > import socket # For gethostbyaddr()
> > File "C:\\python\\python26\\lib\\socket.py", line 46, in <module>
> > import _socket
> > ImportError: DLL load failed: The specified module could not be found.
> > Trac works when I use the standalone server (tracd).
> > I'm using:
> > Python 2.6 (latest)
> > PostgreSQL 8.3 (latest)
> > psycopg2mod_wsgi(which seems to work when I use the example script, apache
> > seems to be configured correctly)
> > Apache 2.2 (latest)
> > Can anybody give me a hand?
> In your WSGI hello world example script add:
> import socket
> Then you will find it probably fails.
> Then replace that with:
> import sys
> print >> sys.stderr, sys.path
> Look in the Apache error log for what sys.path is dumped out as.
> Then search your system for file called '_socket.so'. Presuming that
> is Python modules still have .so extension on Windows, can't remember.
> If that directory isn't in sys.path, then likely that your Python
> module search path is screwed, possibly because of broken Windows
> registry entries.
> Post results of what you get for sys.path and where the _socket
> extension module is located.
... with the caveat that there's not yet a "date" type for custom fields (http://trac.edgewall.org/ticket/1942), so in the meantime one should take care of specifying a date string in a consistent way, like in the ISO 8601 format.