MySQL-python模块无法在Windows中使用Pip安装

时间:2016-10-14 15:02:57

标签: python mysql django mysql-python

我尝试安装MySQL-python模块,但是我收到了以下错误:

很抱歉长代码,但我真的不知道该怎么理解它。 我运行pip install python,pip install Django等启动了一个项目并创建了应用程序...现在我想连接到mysql数据库。

D:\>pip install MySQL-python
Collecting MySQL-python
  Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: MySQL-python
  Running setup.py bdist_wheel for MySQL-python ... error
  Complete output from command c:\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Adrian\\AppData\\Local\\Temp\\pip-build-mrwh3am4\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\Adrian\AppData\Local\Temp\tmpjlbwqr27pip-wheel- --python-tag cp35:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.5
  copying _mysql_exceptions.py -> build\lib.win32-3.5
  creating build\lib.win32-3.5\MySQLdb
  copying MySQLdb\__init__.py -> build\lib.win32-3.5\MySQLdb
  copying MySQLdb\converters.py -> build\lib.win32-3.5\MySQLdb
  copying MySQLdb\connections.py -> build\lib.win32-3.5\MySQLdb
  copying MySQLdb\cursors.py -> build\lib.win32-3.5\MySQLdb
  copying MySQLdb\release.py -> build\lib.win32-3.5\MySQLdb
  copying MySQLdb\times.py -> build\lib.win32-3.5\MySQLdb
  creating build\lib.win32-3.5\MySQLdb\constants
  copying MySQLdb\constants\__init__.py -> build\lib.win32-3.5\MySQLdb\constants
  copying MySQLdb\constants\CR.py -> build\lib.win32-3.5\MySQLdb\constants
  copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.5\MySQLdb\constants
  copying MySQLdb\constants\ER.py -> build\lib.win32-3.5\MySQLdb\constants
  copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.5\MySQLdb\constants
  copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.5\MySQLdb\constants
  copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.5\MySQLdb\constants
  running build_ext
  building '_mysql' extension
  creating build\temp.win32-3.5
  creating build\temp.win32-3.5\Release
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -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:\python35-32\include -Ic:\python35-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /Tc_mysql.c /Fobuild\temp.win32-3.5\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 (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for MySQL-python
  Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
  Running setup.py install for MySQL-python ... error
    Complete output from command c:\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Adrian\\AppData\\Local\\Temp\\pip-build-mrwh3am4\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Adrian\AppData\Local\Temp\pip-ifjg566h-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    copying _mysql_exceptions.py -> build\lib.win32-3.5
    creating build\lib.win32-3.5\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\release.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\times.py -> build\lib.win32-3.5\MySQLdb
    creating build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.5\MySQLdb\constants
    running build_ext
    building '_mysql' extension
    creating build\temp.win32-3.5
    creating build\temp.win32-3.5\Release
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -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:\python35-32\include -Ic:\python35-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /Tc_mysql.c /Fobuild\temp.win32-3.5\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 (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Adrian\\AppData\\Local\\Temp\\pip-build-mrwh3am4\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Adrian\AppData\Local\Temp\pip-ifjg566h-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Adrian\AppData\Local\Temp\pip-build-mrwh3am4\MySQL-python\

0 个答案:

没有答案