Error accessing trac for the first time

41 views
Skip to first unread message

BA

unread,
Mar 31, 2009, 7:44:59 AM3/31/09
to Trac Users
Hello:

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)

Can anybody give me a hand?

Thanks.

Graham Dumpleton

unread,
Mar 31, 2009, 6:47:17 PM3/31/09
to Trac Users


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.

Graham

BA

unread,
Apr 1, 2009, 3:12:14 PM4/1/09
to Trac Users
Hello Graham:

Thank you for your response.

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:

Sajjad Akhter

unread,
Apr 1, 2009, 7:06:34 PM4/1/09
to trac-...@googlegroups.com
Hi,

How can I add custom field like "Deadline" for tickets.

Thanks,
Sajjad

Pacôme MASSOL

unread,
Apr 2, 2009, 4:07:55 AM4/2/09
to trac-...@googlegroups.com

Christian Boos

unread,
Apr 2, 2009, 5:23:01 AM4/2/09
to trac-...@googlegroups.com
Pacôme MASSOL wrote:
> http://trac.edgewall.org/wiki/TracTicketsCustomFields
>
> PM
>

... 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.

-- Christian

Chris Nelson

unread,
Apr 2, 2009, 7:48:04 AM4/2/09
to trac-...@googlegroups.com
Pacôme MASSOL wrote:
> Sajjad Akhter a écrit :
>> Hi,
>>
>> How can I add custom field like "Deadline" for tickets.
>
> http://trac.edgewall.org/wiki/TracTicketsCustomFields

Yes. But isn't the "deadline" for a ticket the due date of its milestone?

Reply all
Reply to author
Forward
0 new messages