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
Thanks @jokey2k it works for me.
I put 32 and 64-bit wheels for Python 3.5 at http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient. These are linked to the multi-threaded DLL runtime (/MD) versions of mysqlclient 5.7.11 for VC14.
Thank You @cgohlke so much!!!
FYI:
MySQL 5.6.29 was released Changes in MySQL 5.6.29 (2016-02-05)
and from above, it seem to have been resolved VS2015 problem.
I'm waiting new release of MySQL Connector/C
thank you so much !!!
Works a charm via pip install. Wondering if anyone knows a way to install the wheel in a virtualenv in PyCharm? Otherwise no worries, I'll just make it available to the whole of 3.5.
Thanks @jokey2k. It works for me. I am using Windows 7 64bit and Python 3.5 installed via Anaconda.
Can someone please explain how to implement @jokey2k 's solution step by step? Thanks.
@ryanhalabi
- Install MySQL server (amd64) with client library.
- Build mysqlclient-python (amd64) with it
- Uninstall MySQL server.
- Install MySQL server (x86) with client library.
- Build mysqlclient-python (x86) with it
- Uninstall MySQL server
I know it, but I don't want to do it... Why MySQL developer don't release MySQL Connector/C for such a long time? It's very annoying.
Thanks @jokey2k the solution worked for me. windows 10, 64 bit system and python 3.5
thanks @cgohlke ; +100 internets to you :+1:
thank you @cgohlke for linking to the 32-bit .whl :D
If you get the error with vcvarsall.bat you could also try to set these environment variables: set DISTUTILS_USE_SDK=1 set MSSdk=1 set PY_VCRUNTIME_REDIST="No Thanks" this works for msvc2013
for later msvc you must set PY_VCRUNTIME_REDIST to a correct path.
This is general the case if you compile modules.
the missing include is fixed after extracting mysql with include directory and setting the INCLUDE environment variable for cl correctly. (also linker variable for sure)
I got it only worky by setting the code page to normal windows code page ("chcp 1252"). Normally i must set it to 65001 cause some modules require this to work.
@kreuzberger Do you mean use msvc2013 (VC13) to build Python 3.5 (based on VC14 runtime) extension module? Is it really safe?
no, sorry for the misunderstanding. I compile python myself with vs2013 too. Mixing is no good idea. but its python 3.5 as asked in the questions.
Hmmm. Why Oracle doesn't release MySQL Connector/C for VC14 for such a long time.... Very annoying...
Hi @jokey2k. I am new to django, can you please create the instruction on how to use the whl file you have provided? thanks!
I've managed to build by myself and uploaded binary wheel for CPython 3.5 amd64. (Building all on Windows from source was not a fun task...)
Can anyone try this?
https://github.com/PyMySQL/mysqlclient-python/releases/download/1.3.7/mysqlclient-1.3.7-cp35-cp35m-win_amd64.whl
I succeeded to build MySQL clientlib in MySQL 5.7.15 in this weekend. I'll release next bugfix version with Python 3.5 Win64 binary wheel.