Python MySQLdb "error: Microsoft Visual C++ 14.0 is required" even though it has been installed

Viewed 2133

I'm attempting to connect to a MySql database and use its data for some code, though when I'm using

pip install mysqlclient

it gives me an error stating:

"error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools"

This link provided does not work, though i found out the correct link and installed the build tools as well as the "Windows 10 SDK" as other posts have specified. I sadly still am getting this error.

Anyone know what is wrong? Thanks!

3 Answers

It's a complicated environment.

I suggest to use pyodbc to connect to your database ( it isn't required by c++ compiler installation)

Try to convert the below code in your program

import pyodbc

conn = pyodbc.connect('DRIVER={MySQL};SOCKET=/var/lib/mysql/mysql.sock;UID=rooter;PWD=sshh') 
Related