Perhaps WSGI is configured to use python 2.4 and the libraries are not linked correctly.
-- Thadeus On Sat, Jul 24, 2010 at 10:58 AM, oktay <onur.ok...@gmail.com> wrote: > Yes, it works with "import MySQLdb" at the top of web2py.py: > > web2py Enterprise Web Framework > Created by Massimo Di Pierro, Copyright 2007-2010 > Version 1.81.5 (2010-07-22 23:56:21) > Database drivers available: MySQL > Starting hardcron... > WARNING:root:GUI not available because Tk library is not installed > > > On 24 Temmuz, 18:52, mdipierro <mdipie...@cs.depaul.edu> wrote: >> As a test, can you try add >> >> import MySQLdb >> >> at the top of web2py.py and run >> >> python2.6 web2py.py >> >> Massimo >> >> On Jul 24, 10:46 am, oktay <onur.ok...@gmail.com> wrote: >> >> > Hello, >> >> > I am trying to install web2py with apache & mysql. >> > I checked all the scenarios with the "global name 'MySQLdb' is not >> > defined" subject, but they didn't solve my problem. >> >> > I am using: >> > CentOS 5.5 >> > httpd-2.2.3 >> > mysql 5.0.77 >> > Python26 >> > MySQL-python-1.2.3c1 >> > web2py Version 1.81.5 >> >> > Default CentOS 5 python version is 2.4, I installed 2.6. >> > I can both "import MySQLdb" from python24 & python26 from console. >> > When I run web2py from source like "python ./web2py.py" or with >> > "python26 ./web2py.py" >> > I can see "Database drivers available: MySQL" >> >> > I think there is a configuration problem with the python libraries I >> > installed. >> >> > Do you have any idea? Here is the trace: >> >> > --------------- >> > Traceback (most recent call last): >> > File "gluon/restricted.py", line 178, in restricted >> > exec ccode in environment >> > File "/var/www/web2py/applications/welcome/models/db.py", line 1, in >> > <module> >> > db=SQLDB('mysql://xxx:y...@zzz:3306/aaa') >> > File "gluon/sql.py", line 921, in __init__ >> > self._pool_connection(lambda : MySQLdb.Connection( >> > File "gluon/sql.py", line 828, in _pool_connection >> > self._connection = f() >> > File "gluon/sql.py", line 921, in <lambda> >> > self._pool_connection(lambda : MySQLdb.Connection( >> > NameError: global name 'MySQLdb' is not defined >> > ---------------- >