Re: django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

3,693 views
Skip to first unread message

Sandeep kaur

unread,
Nov 17, 2012, 1:38:48 AM11/17/12
to django...@googlegroups.com
On Fri, Nov 16, 2012 at 10:59 AM, Cj Taylor <c...@cjcode.com> wrote:
> Hello all,
> I'm new to Django and somewhat Python (a PHP refugee). I have been
> learning Python 3.0 so decided to give 1.5 a run. I tried to run the
> command below and mysqldb is missing. I noticed on
> http://mysql-python.blogspot.com/ that mysqldb won't be ready for 3.0 until
> the 1.3 release. So I guess the question is if there's any kind of
> workaround at the moment?
>
<snip>
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
> No module named MySQLdb
>
Try this :
sudo apt-get install python-mysqldb

--
Sandeep Kaur
E-Mail: mkaur...@gmail.com
Blog: sandymadaan.wordpress.com

Cj Taylor

unread,
Nov 17, 2012, 5:41:41 PM11/17/12
to django...@googlegroups.com
That package installs into my python directory but not python3.  I'm currently trying to get Django 1.5 to work with python3.  Are there other ways currently to get mysql to work with django and the python3 environment?

Sandeep kaur

unread,
Nov 18, 2012, 8:04:15 AM11/18/12
to django...@googlegroups.com
On Sun, Nov 18, 2012 at 4:11 AM, Cj Taylor <c...@cjcode.com> wrote:
> That package installs into my python directory but not python3. I'm
> currently trying to get Django 1.5 to work with python3. Are there other
> ways currently to get mysql to work with django and the python3 environment?

See if this helps :
https://github.com/vsajip/MySQL-for-Python-3

I単igo Medina

unread,
Nov 18, 2012, 4:47:57 PM11/18/12
to django...@googlegroups.com

On Sat, 17 Nov 2012, Cj Taylor wrote:

> That package installs into my python directory but not python3. I'm
> currently trying to get Django 1.5 to work with python3. Are there other
> ways currently to get mysql to work with django and the python3 environment?

Check out pymysql:
https://github.com/petehunt/PyMySQL/

i�

>
> Try this :
>
>> sudo apt-get install python-mysqldb
>>
>> --
>> Sandeep Kaur
>> E-Mail: mkaur...@gmail.com <javascript:>
>> Blog: sandymadaan.wordpress.com
>>
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/VfrRmTUUQrgJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

I単igo Medina

unread,
Nov 18, 2012, 4:48:49 PM11/18/12
to django...@googlegroups.com

On Sat, 17 Nov 2012, Cj Taylor wrote:

> That package installs into my python directory but not python3. I'm
> currently trying to get Django 1.5 to work with python3. Are there other
> ways currently to get mysql to work with django and the python3 environment?

Check out pymysql:
https://github.com/petehunt/PyMySQL/

i�

>
> Try this :
>
>> sudo apt-get install python-mysqldb
>>
>> --
>> Sandeep Kaur

I単igo Medina

unread,
Nov 18, 2012, 4:56:29 PM11/18/12
to django...@googlegroups.com

On Sat, 17 Nov 2012, Cj Taylor wrote:

> That package installs into my python directory but not python3. I'm
> currently trying to get Django 1.5 to work with python3. Are there other
> ways currently to get mysql to work with django and the python3 environment?

Check out pymysql:
https://github.com/petehunt/PyMySQL/

i�

>
> Try this :
>
>> sudo apt-get install python-mysqldb
>>
>> --
>> Sandeep Kaur

Cj Taylor

unread,
Nov 19, 2012, 11:26:21 PM11/19/12
to django...@googlegroups.com, I単igo Medina
ok, so what needs to happen here?  Do I need to recode /usr/local/lib/python3.2/dist-packages/django/db/backends/mysql/base.py to use this new module?


On Sunday, November 18, 2012 4:57:02 PM UTC-5, iñigo medina wrote:

On Sat, 17 Nov 2012, Cj Taylor wrote:

> That package installs into my python directory but not python3.  I'm
> currently trying to get Django 1.5 to work with python3.  Are there other
> ways currently to get mysql to work with django and the python3 environment?

Check out pymysql:
https://github.com/petehunt/PyMySQL/

i�

Sergiy Khohlov

unread,
Nov 20, 2012, 2:08:05 AM11/20/12
to django...@googlegroups.com, I単igo Medina
Which version of django ?
Is this one version has python 3.x support ?

2012/11/20 Cj Taylor <c...@cjcode.com>:
> https://groups.google.com/d/msg/django-users/-/25S322O0_YkJ.

Cj Taylor

unread,
Nov 20, 2012, 9:14:10 AM11/20/12
to django...@googlegroups.com, I単igo Medina
Correct, Sergiy.  As I fiddle with this nightly, the core of my issue seems to be that mysqldb is not yet python3 ready and django 1.5 is calling for it.  I changed my database settings in settings.py to 'django.db.backends.mysql' which in return calls for mysqldb when I do:

python manage.py syncdb

I suppose at this point I'm just seeking anyone who has tried to run django 1.5 and has MySQL actually working.  If so, how?

Tom Evans

unread,
Nov 20, 2012, 10:03:16 AM11/20/12
to django...@googlegroups.com
On Tue, Nov 20, 2012 at 2:14 PM, Cj Taylor <c...@cjcode.com> wrote:
> Correct, Sergiy. As I fiddle with this nightly, the core of my issue seems
> to be that mysqldb is not yet python3 ready and django 1.5 is calling for
> it. I changed my database settings in settings.py to
> 'django.db.backends.mysql' which in return calls for mysqldb when I do:
>
> python manage.py syncdb
>
>
> I suppose at this point I'm just seeking anyone who has tried to run django
> 1.5 and has MySQL actually working. If so, how?
>

I guess this is the meaning of 'experimental support'. Patches are
probably welcome, or you could use sqlite or postgres.

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages