3

i was trying to install two python libs named mysql-python and mysqlclient(fork of mysql-python) then when i try to install it using pip i get this error:

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:\python 3.5\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\2\\pip-build-32um1ofe\\mysql-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ADMINI~1\AppData\Local\Temp\2\pip-dm8bja_5-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:\python 3.5\include" "-Ic:\python 3.5\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.10150.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\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

    ----------------------------------------

i have already read "Cannot open include file: 'config-win.h': No such file or directory" while installing mysql-python but it did not help me.my mysql is installed in C:/xampp/ and im using windows server 2008 x64 with python 3.5 32bit note : please dont votedown i cant get help from any other questions!

Community
  • 1
  • 1
Ali SH
  • 403
  • 1
  • 6
  • 16
  • Which mysql version are you trying to install? –  Oct 19 '15 at 20:02
  • mysql Server version: 5.5.39 - MySQL Community Server (GPL).And mysql-python version 1.2.5 – Ali SH Oct 19 '15 at 20:05
  • 1
    Try to install the version 1.2.3 from here: http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/ –  Oct 19 '15 at 20:12
  • i cant test it right now, im using python 3.5. do you know which version i should use in mysqlclient? – Ali SH Oct 19 '15 at 20:22
  • Not at all, but if you are having those issues with the most recent version try an older one / change the system of installation –  Oct 19 '15 at 20:35
  • Anyway, check the link under "MySQLdb Installation" and find the most suitable for you –  Oct 19 '15 at 20:37
  • ummm... before that. im using VS2015(VS14) and i heared it doesnt support mysql connector/c yet. is that true? – Ali SH Oct 19 '15 at 21:02
  • MySQL works properly up to VS2013, take a read to: http://dev.mysql.com/doc/relnotes/mysql-for-visual-studio/en/visual-studio-news-1-2-4.html –  Oct 20 '15 at 12:52

2 Answers2

2

i know this question is dirt old but the soloution is: installing vs2010 and then installing and it will install without problems! edit: you can use official mysql connector for python.it can be easily downloaded from here for all platforms!

Ali SH
  • 403
  • 1
  • 6
  • 16
0

You can download a binary from source:

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

where cp[python version] win_[architecture]

and install it:

pip install wheel

pip install mysqlclient‑1.3.12‑cp36‑cp36m‑win_amd64.whl

Don't use official mysql connector for python, it's usually 2x time slower then mysql-python !

  • MySQL_python-1.2.5-cp27-none-win_amd64.whl MySQL_python-1.2.5-cp27-none-win_amd64.whl is not a supported wheel on this platform. I am using Windows 10 (x64) Professional – user2063329 Jul 19 '18 at 22:11