Not working with python 3.5
This is the error I get when I try installing mysqlclient. I am using Windows and python 3.5.
Installing 'mysqlclient'
Collecting mysqlclient
Using cached mysqlclient-1.3.6.tar.gz
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient
Complete output from command "c:\users\buccaneer\documents\visual studio 2013\Projects\del1\del1\envrm\Scripts\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\BUCCAN~1\\AppData\\Local\\Temp\\pip-build-wuhkxhu3\\mysqlclient\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\BUCCAN~1\AppData\Local\Temp\pip-3jbluuk2-record\install-record.txt --single-version-externally-managed --compile --install-headers "c:\users\buccaneer\documents\visual studio 2013\Projects\del1\del1\envrm\include\site\python3.5\mysqlclient":
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\compat.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
error: Unable to find vcvarsall.bat
The reported problem with vcvarsall.bat missing goes away if you install Visual Studio 14.0 with Python Tools for Visual Studio, which is an option under Programming Languages selection.
However, thereafter another problem pops up reelated to missing 'my_config.h':
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,3,6,'final',1) -D__version__=1.3.6 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" "-Ic:\apps\python 3.5\include" "-Ic:\apps\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.10240.0\ucrt" "-IC:\Program Files (x86)\WindowsKits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" /Tc_mysql.c /Fobuild\temp.win32-3.5\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29): fatal error C1083: Cannot open include file: 'my_config.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
Building MySQL-python on Windows is hard. You should build from source instead of pip install since you need to edit setup.cfg file.
To make pip installable, I built binary wheels for Windows. But I haven't built wheel for Python 3.5 yet. I hope I can build it in near future.
Adding to my own post: my_config.h becomes available after installing MySQL with development option. But even then the building process fails because it looks for the file from C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include although it becomes installed into C:\Program Files\MySQL\MySQL Connector.C 6.1\include.
Perhaps I'll wait until mysqlclient‑1.3.6‑cp35‑none‑win32.whl becomes available at http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient...
MySQL Connector/C doesn't support VS 2015 yet.
Hi guys, same problem here. Has anyone found out if uninstalling Python tools from VS2015 makes the problem disappear? Or do we just have to wait for the 3.5 package?
For me Python in VS is nice-to-have but not have-to-have.
I can't build extension module for Python 3.5 for now. I hope new MySQL Connector/C supports VS 2015...
Anyone figured this out yet? I'm using Windows 10, VS 2015, Python 3.5 64bit.
ref: http://bugs.mysql.com/bug.php?id=78282
This bug should be fixed for building Python's mysqlclient on Python 3.5
methane, can you explain how? I'm still having difficulty. I'm not using pip rather compiling the project using python setup.py install after modifying site.cfg to point to the correct location of MySQL Connector.
Python 3.5 uses VS2015. But current MySQL can't compile under VS2015. So I can't build mysqlclient-python for Python 3.5 without VCRT mismatch.
Since I'm not Windows expert, I can't build dual-VCRT library. And I don't want to support it if I can build it.
Confirming error with VS2015 while trying to install via PyCharm:
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2
It doesn't work for python3.5 on ubuntu 15.04 too. Hand to edit /usr/bin/pip3 so that !#/usr/bin/python3.5 was now !#/usr/bin/python3 before it was able to install
Up ! Nobody gots answer???
This is a issue of MySQL. I can't do anything until they make a new release.
You can just link against the version shipped with mysql, I did it for py3.5/win64, linked against mysqlclient from mysql 5.7.10 http://pyside.markus-ullmann.de/mysqlclient-win/mysqlclient-1.3.7-cp35-none-win_amd64.whl
Thanks @jokey2k . It works for me. Your suggestion saved me much of lost time. I am using Windows 7 and Python 3.5 installed via Anaconda.
@jokey2k: strangely enough pip install
Thanks @jokey2k! That was just what I have been looking for!
You're welcome :-)
Thanks @jokey2k ! is it also possible to have mysqlclient-1.3.7-cp35-none-win32.whl ?