Django mysqldb模块无法在Windows Vista上安装:加载MySQLdb模块时出错:没有名为MySQLdb的模块

时间:2022-03-11 18:03:53

I have this error from my installation of mysql-python module for django on a Windows vista platform:

我在Windows Vista平台上为django安装mysql-python模块时出现此错误:

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

django.core.exceptions.ImproperlyConfigured:加载MySQLdb模块时出错:没有名为MySQLdb的模块

I have gone through the errors 'spat' out and tried to locate the config-w.h file VC compiler is looking for but to no avail and Im not sure what to do next (update VC compiler (v9) or remove version and stick with lower version 8 [already on system])

我已经完成了错误'spat',并尝试找到VC编译器正在寻找的config-wh文件,但没有用,我不知道下一步该做什么(更新VC编译器(v9)或删除版本并坚持使用较低版本版本8 [已在系统上])

Any help is greatly appreciated :)

任何帮助是极大的赞赏 :)

Raw output:

Collecting MYSQl-python
  Using cached MySQL-python-1.2.5.zip
Installing collected packages: MYSQl-python
  Running setup.py install for MYSQl-python
    Complete output from command C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\i0101010\\appdata\\local\\temp\\pip-build-1vscsn\\MYSQl-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\i0101010\appdata\local\temp\pip-zui5a7-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-2.7
    copying _mysql_exceptions.py -> build\lib.win32-2.7
    creating build\lib.win32-2.7\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\release.py -> build\lib.win32-2.7\MySQLdb
    copying MySQLdb\times.py -> build\lib.win32-2.7\MySQLdb
    creating build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win32-2.7\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-2.7\MySQLdb\constants

    running build_ext
    building '_mysql' extension
    creating build\temp.win32-2.7
    creating build\temp.win32-2.7\Release
    C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python27\include -IC:\Python27\PC /Tc_mysql.c /Fobuild\temp.win32-2.7\Release\_mysql.obj /Zl_mysql.c
    _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':No such file or directory
    error: command 'C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\BIN\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\i0101010\\appdata\\local\\temp\\pip-build-1vscsn\\MYSQl-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\i0101010\appdata\local\temp\pip-zui5a7-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\i0101010\appdata\local\temp\pip-build1vscsn\MYSQl-python

Screenshot: Django mysqldb模块无法在Windows Vista上安装:加载MySQLdb模块时出错:没有名为MySQLdb的模块

1 个解决方案

#1


0  

Well I managed to get around the issue using easy_install instead. This solved my problem and I hope it helps someone out there too, Do not rely solely on pip :)

好吧,我设法使用easy_install解决了这个问题。这解决了我的问题,我希望它也可以帮助那里的人,不要单独依靠点子:)

easy_install MYSQL-python

#1


0  

Well I managed to get around the issue using easy_install instead. This solved my problem and I hope it helps someone out there too, Do not rely solely on pip :)

好吧,我设法使用easy_install解决了这个问题。这解决了我的问题,我希望它也可以帮助那里的人,不要单独依靠点子:)

easy_install MYSQL-python