Installing MySQLclient in Python 3.6 in Windows

Installing mysqlclient in Python 3.6 in windows

I can't find mysqlclient-1.3.13's whl file on PyPi. So you need to compile it from source. Unfortunately it's not easy. I'm not Windows guy, so I only can recommend guide like this

pip install mysqlclient : Microsoft Visual C++ 14.0 is required

First install python 3.6.5, then run

pip install mysqlclient==1.3.12

pip install mysqlclient on win64 not working giving error 'Cannot open file: 'mysql.h'

I just got an answer by looking at other options mentioned here.
Actually mistake was that,

  • I have installed Python 3.7.4 with 32 bits on 64bits machine.
  • Code was looking for below path but it was going to the wrong path in program files instead of program files(x86)

C:\Program Files (x86)\MySQL\MySQL Connector C 6.1\lib

I have installed a new Python with 3.7 with 64 bits and also while installing MySQL connector I have changed the path of installation to the above-mentioned path and now it's working fine.

Thank you, everyone, for your time and help

I am trying to install pip install mysqlclient and it fails everytime. Tried all other things but also didnt work. What should I do?

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft
Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

From the error message its pretty clear that the issue is with with C++ installation on your machine.

FYI: Many Python libs uses C++ under the hood so its mandatory to install the Microsoft visual c++(on windows) as mentioned in the error.
You can go ahead and install Microsoft Visual C++ from here or here

Or else if there is no particular use behind mysqlclient you can use this pure pyython MySQL client library named PyMySQL (you need not install visual c++ for using this lib).

Install mysqlclient for Python 3.6 on a Raspbian system

import MySQLdb

mysqlclient is just a fork of MySQLdb

pip install django mysqlclient 'path should be string, bytes, os.PathLike or integer, not NoneType' on windows

As Alasdair said , using 64 bit solve problem.thanks Alasdair.

pip install mysqlclient returns fatal error C1083: Cannot open file: 'mysql.h': No such file or directory

You can download unofficial windows binaries for your python version using https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient. Then install it using pip. This way you'll be able to avoid the hassle of dealing with visual studio build tools.

Just download the mysqlclient.whl file most applicable to you. I think in your case it'll be

mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl

and run

pip install "path to the downloaded .whl file"


Related Topics



Leave a reply



Submit