Python 3.7, Failed building wheel for MySql-Python


Python 3.7, Failed building wheel for MySql-Python



I am new to python and I am trying django framework that involves some MySql and ran into this error when try to do pip install mysqlclient and down the lines of cmd messages I got this.


pip install mysqlclient


Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
Complete output from command c:usersronanl~1envspy1scriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\RONANL~1\AppData\Local\Temp\pip-install-pkbqy3t3\mysqlclient\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersRONANL~1AppDataLocalTemppip-record-moxwf7luinstall-record.txt --single-version-externally-managed --compile --install-headers c:usersronanl~1envspy1includesitepython3.7mysqlclient:
running install
running build
running build_py
creating build
creating buildlib.win32-3.7
copying _mysql_exceptions.py -> buildlib.win32-3.7
creating buildlib.win32-3.7MySQLdb
copying MySQLdb__init__.py -> buildlib.win32-3.7MySQLdb
copying MySQLdbcompat.py -> buildlib.win32-3.7MySQLdb
copying MySQLdbconnections.py -> buildlib.win32-3.7MySQLdb
copying MySQLdbconverters.py -> buildlib.win32-3.7MySQLdb
copying MySQLdbcursors.py -> buildlib.win32-3.7MySQLdb
copying MySQLdbrelease.py -> buildlib.win32-3.7MySQLdb
copying MySQLdbtimes.py -> buildlib.win32-3.7MySQLdb
creating buildlib.win32-3.7MySQLdbconstants
copying MySQLdbconstants__init__.py -> buildlib.win32-3.7MySQLdbconstants
copying MySQLdbconstantsCLIENT.py -> buildlib.win32-3.7MySQLdbconstants
copying MySQLdbconstantsCR.py -> buildlib.win32-3.7MySQLdbconstants
copying MySQLdbconstantsER.py -> buildlib.win32-3.7MySQLdbconstants
copying MySQLdbconstantsFIELD_TYPE.py -> buildlib.win32-3.7MySQLdbconstants
copying MySQLdbconstantsFLAG.py -> buildlib.win32-3.7MySQLdbconstants
copying MySQLdbconstantsREFRESH.py -> buildlib.win32-3.7MySQLdbconstants
running build_ext
building '_mysql' extension
creating buildtemp.win32-3.7
creating buildtemp.win32-3.7Release
C:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428binHostX86x86cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-IC:Program Files (x86)MySQLMySQL Connector C 6.1include" "-Ic:usersronan linaappdatalocalprogramspythonpython37-32include" "-Ic:usersronan linaappdatalocalprogramspythonpython37-32include" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428ATLMFCinclude" "-IC:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.14.26428include" "-IC:Program Files (x86)Windows KitsNETFXSDK4.6.1includeum" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0ucrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0shared" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0um" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0winrt" "-IC:Program Files (x86)Windows Kits10include10.0.17134.0cppwinrt" /Tc_mysql.c /Fobuildtemp.win32-3.7Release_mysql.obj /Zl
_mysql.c
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\cl.exe' failed with exit status 2
>
>
> Command "c:usersronanl~1envspy1scriptspython.exe -u -c "import setuptools, tokenize;__file__='C:\Users\RONANL~1\AppData\Local\Temp\pip-install-pkbqy3t3\mysqlclient\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UsersRONANL~1AppDataLocalTemppip-record-moxwf7luinstall-record.txt --single-version-externally-managed --compile --install-headers c:usersronanl~1envspy1includesitepython3.7mysqlclient" failed with error code 1 in C:UsersRONANL~1AppDataLocalTemppip-install-pkbqy3t3mysqlclient



anyone knows how to fix this ?





This might help: stackoverflow.com/a/4290261/747744
– Eugene Primako
Jun 30 at 18:51





doesn't answer my problem or atleast I don't understand how it does.
– ronan
Jun 30 at 19:41





I can’t help with building the wheel for Python 3.7, but if you just want to use Python 3 with mysqlclient, then pip install mysqlclient==1.3.12 With Python 3.6 should install a prebuilt wheel without any issues.
– Alasdair
Jun 30 at 20:18



pip install mysqlclient==1.3.12





You could try this unofficial wheel lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
– iklinac
Jun 30 at 21:07





Glad you got it working. It’s best to use the latest 3.6.x, to make sure you get the latest bug and security fixes.
– Alasdair
Jul 1 at 14:38









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

List of Kim Possible characters

Audio Livestreaming with Python & Flask

NSwag: Generate C# Client from multiple Versions of an API