you may have different python versions installed. Check the one used
by modwsgi

On Nov 9, 3:02 pm, azarkowsky <[email protected]> wrote:
> Hi,
>
> I'm relatively new to web2py and am attempting to set up my production
> environment for the first time.  I'm running Apache2.2 with mod_wsgi,
> python 2.7, & web2py 1.88.2 on Win XP SP3.  If I run web2py without
> Apache by running:  'python web2py.py -a "<recycle>" -i 127.0.0.1 -p
> 8000' I can access both my application and the admin interface without
> any problems.  Once I try to access my site running behind Apache
> though, I receive a ticket containing the following trackback:
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "C:/web2py/applications/lunch/models/db.py", line 11, in
> <module>
>     db = DAL('mssql://lunch:lu...@b1ts003/lunch1')
>   File "C:\web2py\gluon\sql.py", line 4048, in DAL
>     raise RuntimeError, "%s (tried 5 times)" % exception
> RuntimeError: global name 'pyodbc' is not defined (tried 5 times)
>
> If I run web2py in terminal mode and import pyodbc I don't receive any
> errors:
>
> C:\web2py>python web2py.py -S welcome -P
> No handlers could be found for logger "web2py"
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.88.2 (2010-10-29 23:04:43)
> Database drivers available: SQLite3, MSSQL/DB2
> Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit
> (Intel)] on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
>
> >>> import pyodbc
>
> I'm sure I'm probably just missing something in my confiration, but
> after scouring the web2py book and searching Google I haven't been
> able to find a solution.  I'd greatly appreciate any suggestions, or
> if you need additional info, please let me know!
>
> Thanks,
> Adam

Reply via email to