0

Just installed Django (with easy_install) and created a project, but can't get mysql to work.

python manage.py syncdb throws this error:

.....
File "/Library/Python/2.6/site-packages/Django-1.1.1-py2.6.egg/django/db/backends/mysql/base.py", line 13, in <module>
 raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
 django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

I have MAMP installed and path to MySQL is probably: /Applications/MAMP/Library/bin/mysql

Thanks!

asked Nov 23, 2009 at 7:34
1
  • Do you have MySQLdb python library installed? Commented Nov 23, 2009 at 7:46

2 Answers 2

3

you need Python library for MySQL access, MySQLdb:

http://sourceforge.net/projects/mysql-python/

answered Nov 23, 2009 at 7:46
Sign up to request clarification or add additional context in comments.

2 Comments

Oh, I need to install this although I have MySQL installed (forgive my technical virginity)? I just tried "easy_install -Z mysql_python" but it also give an error: "EnvironmentError: mysql_config not found"
@Nimbuz: It seems mysql_config is a command line tool that is part of the MySQL client library. On Debian you'd have to install "libmysqlclient15-dev", but apparently you use Mac OS X, so I can't help you with that.
0

The MySQL egg requires a compiler from the dev tools (download XCode from the apple developers site) and a MySQL installation.

If you have installed those, you have set the PATH to include mysql_config.

export PATH=$PATH:/usr/local/mysql-5.1.39-osx10.5-x86_64/bin/

Check the path, as this is the installation on my machine!

After that, you should be able to build the egg with easy_install.

Good google terms are MySQLdb OS X Snow Leopard.

Undo
25.7k38 gold badges114 silver badges132 bronze badges
answered Nov 23, 2009 at 14:01

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.