0

I encounter an error when I run

python manage.py syncdb


...
  File "/Users/Marcus/Documents/Django/venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb

My Setup:

$ pip list

Django (1.5.4)
pip (1.4.1)
setuptools (0.6c11)
stevedore (0.10)
virtualenv-clone (0.2.4)
virtualenvwrapper (4.1.1)
wsgiref (0.1.2)

When I do $ pip install mysql-python I get a "error: invalid command 'egg_info'

I'm currently running MAMP, but I haven't changed any of the settings . MySQL Server is green.

Any ideas how to fix this

2 Answers 2

1

If you are using Ubuntu try this:

sudo apt-get install build-essential python-dev libmysqlclient-dev

This solve the error for me.

Sign up to request clarification or add additional context in comments.

3 Comments

If you have brew, try this: brew install mysql
Check this: pip install --upgrade setuptools
Or try to install MySQL from dev.mysql.com/downloads/mysql I am using Mac OSX 10.8 too and I do not have the problem, I just install that mysql and setup tools in my Mac
1

If you're working on a mac, I highly recommend using a virtual machine with some linux distribution http://www.vagrantup.com/ to avoid having this kind of problem installing libraries in mac os

Comments

Your Answer

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.