问题
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module
named MySQLdb
python-version :2.7
django -version:1.6.2
解决方案
pip install mysqlclient==1.3.9
// 不指定版本号会出现下面错误
Command "d:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\admin\\appdata\\local\\temp\\pip-build-egxurc\\mysql-
python\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record
c:\users\admin\appdata\local\temp\pip-bqtcds-record\install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in
c:\users\admin\appdata\local\temp\pip-build-egxurc\mysql-python\
或者
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
----------------------------------------
Command "d:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\admin\\appdata\\local\\temp\\pip-build-
yry9n_\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))"
install --record c:\users\admin\appdata\local\temp\pip-ja7sdl-record\install-record.txt --
single-version-externally-managed --compile" failed with error code 1 in
c:\users\admin\appdata\local\temp\pip-build-yry9n_\mysqlclient\