Error loading MySQLdb module

107 views
Skip to first unread message

Jalil

unread,
Jul 6, 2007, 8:38:05 PM7/6/07
to django...@googlegroups.com
I keep getting this below error when I try to sync my database. 
I am using python2.3. Any ideas?



[no job set:~/dev/mysite] 113% python2.3  manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 11, in ?
    execute_manager(settings)
  File "/usr/lib/python2.3/site-packages/django/core/management.py", line 1672, in execute_manager
    execute_from_command_line(action_mapping, argv)
  File "/usr/lib/python2.3/site-packages/django/core/management.py", line 1571, in execute_from_command_line
    action_mapping[action](int(options.verbosity), options.interactive)
  File "/usr/lib/python2.3/site-packages/django/core/management.py", line 486, in syncdb
    from django.db import connection, transaction, models, get_creation_module
  File "/usr/lib/python2.3/site-packages/django/db/__init__.py", line 11, in ?
    backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, {}, {}, [''])
  File "/usr/lib/python2.3/site-packages/django/db/backends/mysql_old/base.py", line 12, in ?
    raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
bykergrove [no job set:~/dev/mysite] 114%

Bryan L. Fordham

unread,
Jul 6, 2007, 8:42:41 PM7/6/07
to django...@googlegroups.com
looks like you need to install MySQLdb:
http://sourceforge.net/projects/mysql-python

Kelsey Ruger

unread,
Aug 12, 2007, 1:32:16 AM8/12/07
to Django users
I have the same problem even though I have installed MySQLdb.

On Jul 6, 3:42 pm, "Bryan L. Fordham" <bford...@socialistsushi.com>
wrote:

James Bennett

unread,
Aug 12, 2007, 1:39:22 AM8/12/07
to django...@googlegroups.com
On 8/11/07, Kelsey Ruger <kel...@themoleskin.com> wrote:
> I have the same problem even though I have installed MySQLdb.

Open up a Python interpreter, and try:

import MySQLdb

If you see an ImportError, MySQLdb may have been installed into a
location that's not on your Python import path; you can fix this by
changing the environment variable PYTHONPATH to include the directory
into which MySQLdb was installed (not the location of MySQLdb itself,
but the directory in which it can be found), like so:

export PYTHONPATH=/dir/where/mysqldb/lives:$PYTHONPATH

Placing that in the file '.bashrc' in your home directory will cause
it to be set automatically for you any time you open up a shell.


--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

ner...@gmail.com

unread,
Aug 28, 2007, 5:41:02 AM8/28/07
to Django users
where might I find the PYTHONPATH variable?

On Aug 11, 6:39 pm, "James Bennett" <ubernost...@gmail.com> wrote:
> On 8/11/07, Kelsey Ruger <kel...@themoleskin.com> wrote:
>
> > I have the same problem even though I have installedMySQLdb.
>
> Open up a Python interpreter, and try:
>
> importMySQLdb
>

> If you see an ImportError,MySQLdbmay have been installed into a

Reply all
Reply to author
Forward
0 new messages