1

I have spent hours trying multiple approaches to install MYSQLDB module for python, and no success.

My python version: 2.7.6

Django - 1.10.3

OS: Windows 7 64-bit

MySQL connector - MySQL Connector C 6.0.2

Currently I have an error in my project, namely:

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

I have tried to install mysqldb running the following command:

pip install mysql-python

It ran successfully, but the error still persisted. Then I tried to run

pip install MySQL-python

and I am getting Cannot open include file config-win.h. I came across this post, but I don't understand the idea of the answer, specifically, I can't figure out where I should look for the mentioned files site.cfg and setup_windows.py. There are no such files in C:\Program Files\MySQL\MySQL Connector C 6.0.2\include

Finally, I tried to install MySQLDb using wheels running pip install mysqlclient-1.3.9-cp27-cp27m-win_amd64.whl command, I end up with

mysqlclient-1.3.9-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform error.

I have lost my hope. Help please !!!

1 Answer 1

3

Try to install 32 bit version mysqlclient-1.3.9-cp27-cp27m-win32.whl

If it doesn't work try to install it from (where you can find compiled windows libraries):

http://www.lfd.uci.edu/~gohlke/pythonlibs/

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

2 Comments

Yes, it works indeed ! But won't it lead to hard to fix errors in the future - I mean running 32-version on 64 machine ?
Maybe you have 32 bit version of MySQL. Reinstall it and try again, but I'm not sure if you will be able to install mysqlclient-1.3.9-cp27-cp27m-win_amd64.whl after that.

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.