Message from discussion
Django failed to load MySQLdb module
Received: by 10.58.191.68 with SMTP id gw4mr10802843vec.20.1351709630414;
Wed, 31 Oct 2012 11:53:50 -0700 (PDT)
X-BeenThere: reviewboard@googlegroups.com
Received: by 10.220.108.198 with SMTP id g6ls1396800vcp.1.gmail; Wed, 31 Oct
2012 11:53:48 -0700 (PDT)
Received: by 10.52.175.5 with SMTP id bw5mr6931905vdc.16.1351709628894;
Wed, 31 Oct 2012 11:53:48 -0700 (PDT)
Date: Wed, 31 Oct 2012 11:53:48 -0700 (PDT)
From: Zhu Wayne <zhuw.chic...@gmail.com>
To: reviewboard@googlegroups.com
Message-Id: <8ff0eaa2-9589-4b14-a7a3-f7d362a66c10@googlegroups.com>
Subject: Django failed to load MySQLdb module
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_692_12621586.1351709628401"
------=_Part_692_12621586.1351709628401
Content-Type: multipart/alternative;
boundary="----=_Part_693_33445247.1351709628401"
------=_Part_693_33445247.1351709628401
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
I am using Python 2.4.3 and can import MySQLdb without any issue in the
shell.
$python -V
Python 2.4.3
$python
Python 2.4.3 (#1, Nov 3 2010, 12:52:40)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb;
However, httpd log shows error:
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] mod_wsgi (pid=550):
Exception occurred processing WSGI script '/
var/www/reviews.com/htdocs/reviewboard.wsgi'.
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/core/handlers/wsgi.py", line 250, in __call__
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1]
self.load_middleware()
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/core/handlers/base.py", line 45, in load_middleware
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] mod =
import_module(mw_module)
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/utils/importlib.py", line 35, in import_module
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] __import__(name)
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Djblets-0.6.23-py2.4.eg
g/djblets/siteconfig/middleware.py", line 27, in ?
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] from
djblets.siteconfig.models import SiteConfiguration
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Djblets-0.6.23-py2.4.eg
g/djblets/siteconfig/models.py", line 26, in ?
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] from
django.contrib.sites.models import Site
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/contrib/sites/models.py", line 1, in ?
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] from django.db
import models
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/db/__init__.py", line 78, in ?
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] connection =
connections[DEFAULT_DB_ALIAS]
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/db/utils.py", line 93, in __getitem__
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] backend =
load_backend(db['ENGINE'])
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/db/utils.py", line 33, in load_backend
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] return
import_module('.base', backend_name)
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/utils/importlib.py", line 35, in import_module
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] __import__(name)
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] File
"/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4.egg/
django/db/backends/mysql/base.py", line 14, in ?
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] raise
ImproperlyConfigured("Error loading MySQLdb module: %s
" % e)
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] ImproperlyConfigured:
Error loading MySQLdb module: No module na
med MySQLdb
[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] mod_wsgi (pid=553):
Exception occurred processing WSGI script '/
var/www/reviews.com/htdocs/reviewboard.wsgi'.
Anyone knows how to fix it? I am not an expert on Python.
------=_Part_693_33445247.1351709628401
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
I am using Python 2.4.3 and can import MySQLdb without any issue in the she=
ll.<br>$python -V<br>Python 2.4.3<br>$python<br>Python 2.4.3 (#1, Nov =
3 2010, 12:52:40)<br>[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2<br>=
Type "help", "copyright", "credits" or "license" for more information.<br>&=
gt;>> import MySQLdb;<br><br>However, httpd log shows error:<br>[Wed =
Oct 31 11:36:27 2012] [error] [client 127.0.0.1] mod_wsgi (pid=3D550): Exce=
ption occurred processing WSGI script '/<br>var/www/reviews.com/htdocs/revi=
ewboard.wsgi'.<br>[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] Tra=
ceback (most recent call last):<br>[Wed Oct 31 11:36:27 2012] [error] [clie=
nt 127.0.0.1] File "/usr/lib/python2.4/site-packages/Django-1.3=
.3-py2.4.egg/<br>django/core/handlers/wsgi.py", line 250, in __call__<br>[W=
ed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] =
self.load_middleware()<br>[Wed Oct 31 11:36:27 2012] [error] [client 127.0=
.0.1] File "/usr/lib/python2.4/site-packages/Django-1.3.3-py2.4=
.egg/<br>django/core/handlers/base.py", line 45, in load_middleware<br>[Wed=
Oct 31 11:36:27 2012] [error] [client 127.0.0.1] m=
od =3D import_module(mw_module)<br>[Wed Oct 31 11:36:27 2012] [error] [clie=
nt 127.0.0.1] File "/usr/lib/python2.4/site-packages/Django-1.3=
.3-py2.4.egg/<br>django/utils/importlib.py", line 35, in import_module<br>[=
Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1]  =
; __import__(name)<br>[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1]=
File "/usr/lib/python2.4/site-packages/Djblets-0.6.23-py2.4.eg=
<br>g/djblets/siteconfig/middleware.py", line 27, in ?<br>[Wed Oct 31 11:36=
:27 2012] [error] [client 127.0.0.1] from djblets.s=
iteconfig.models import SiteConfiguration<br>[Wed Oct 31 11:36:27 2012] [er=
ror] [client 127.0.0.1] File "/usr/lib/python2.4/site-packages/=
Djblets-0.6.23-py2.4.eg<br>g/djblets/siteconfig/models.py", line 26, in ?<b=
r>[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] &n=
bsp; from django.contrib.sites.models import Site<br>[Wed Oct 31 11:36:27 2=
012] [error] [client 127.0.0.1] File "/usr/lib/python2.4/site-p=
ackages/Django-1.3.3-py2.4.egg/<br>django/contrib/sites/models.py", line 1,=
in ?<br>[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] &=
nbsp; from django.db import models<br>[Wed Oct 31 11:36:27 2012] [err=
or] [client 127.0.0.1] File "/usr/lib/python2.4/site-packages/D=
jango-1.3.3-py2.4.egg/<br>django/db/__init__.py", line 78, in ?<br>[Wed Oct=
31 11:36:27 2012] [error] [client 127.0.0.1] conne=
ction =3D connections[DEFAULT_DB_ALIAS]<br>[Wed Oct 31 11:36:27 2012] [erro=
r] [client 127.0.0.1] File "/usr/lib/python2.4/site-packages/Dj=
ango-1.3.3-py2.4.egg/<br>django/db/utils.py", line 93, in __getitem__<br>[W=
ed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] =
backend =3D load_backend(db['ENGINE'])<br>[Wed Oct 31 11:36:27 2012] [erro=
r] [client 127.0.0.1] File "/usr/lib/python2.4/site-packages/Dj=
ango-1.3.3-py2.4.egg/<br>django/db/utils.py", line 33, in load_backend<br>[=
Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1]  =
; return import_module('.base', backend_name)<br>[Wed Oct 31 11:36:27 2012]=
[error] [client 127.0.0.1] File "/usr/lib/python2.4/site-packa=
ges/Django-1.3.3-py2.4.egg/<br>django/utils/importlib.py", line 35, in impo=
rt_module<br>[Wed Oct 31 11:36:27 2012] [error] [client 127.0.0.1] &nb=
sp; __import__(name)<br>[Wed Oct 31 11:36:27 2012] [error] [cli=
ent 127.0.0.1] File "/usr/lib/python2.4/site-packages/Django-1.=
3.3-py2.4.egg/<br>django/db/backends/mysql/base.py", line 14, in ?<br>[Wed =
Oct 31 11:36:27 2012] [error] [client 127.0.0.1] ra=
ise ImproperlyConfigured("Error loading MySQLdb module: %s<br>" % e)<br>[We=
d Oct 31 11:36:27 2012] [error] [client 127.0.0.1] ImproperlyConfigured: Er=
ror loading MySQLdb module: No module na<br>med MySQLdb<br>[Wed Oct 31 11:3=
6:27 2012] [error] [client 127.0.0.1] mod_wsgi (pid=3D553): Exception occur=
red processing WSGI script '/<br>var/www/reviews.com/htdocs/reviewboard.wsg=
i'.<br><br>Anyone knows how to fix it? I am not an expert on Python. <br><b=
r>
------=_Part_693_33445247.1351709628401--
------=_Part_692_12621586.1351709628401--