• Register
0 votes
1.7k views

Problem :

Following is my issue: I tried to install mysqlclient like below :

C:\Users\alecxe>pip install mysqlclient Collecting mysqlclient Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1 cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz

Installed collected packages: mysqlclient

Ran setup.py install for mysqlclient

After that ran build_ext

Got below error :

building '_mysql' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual 
_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\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

 I am the complete beginner to this and would be very happy if any input as to how to go about fixing above error.

6 5 3
7,540 points

1 Answer

0 votes

Solution :

I had the same issue and tried all the solutions which I knew, and neither of them worked actually after long research I found the solution for the error as below:

Firstly I tried installing MySQL Connector/C from here

Secondly I tried copying MySQL Connector C 6.1 folder from the Program files/MySQL into the  Program files (x86)/MySQL

Please note that you might have to create the MySQL folder if it does not exist in your Program files (x86).

It worked for me, it seems it is for all 64-bit windows, pip or more.  Most probably mysqlclient setup script only looks for Program files (x86) folder for some MySQL files for e.g. 'mysql.h' and do not search Program files and since it did not find anything in your Program files (x86) it will raise the error !!

 

9 7 4
38,600 points
Thanks AbhijitJ, I was also having the similar issue, and your solution worked.

Related questions

1 vote
1 answer 340 views
340 views
Problem : I have recently installed the Visual Studio 2015 on my Windows 10 laptop. I have tried to clone the repository with the solution created with the same version of Visual Studio (update 3) on my another PC, always with windows 10. But when I try to build the ... my issue? I know one thing that I can update my laptop to the same windows version but I want to avoid it for many reasons.
asked Dec 14, 2019 alecxe 7.5k points
2 votes
1 answer 1.4K views
1.4K views
Problem: When I try to run the below command on my command prompt: python get-pip.py It shows the following message: C:\Users\ASUS>python get-pip.py python: can't open file 'get-pip.py': [Errno 2] No such file or directory How can I have pip installed in my system. Then why am I getting this error message and why I can not open this file. Thanks in advance.
asked May 6 samhaz 5k points
0 votes
1 answer 1.2K views
1.2K views
Problem : I am very new to Quartz. So whenever I try to install Quartz on my system using pip install Quartz, I face the following error. Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> ... [Errno 2] No such file or directory: 'requirements.txt' I am using Mac OSX with Anaconda. Does anyone have any clue on this issue?
asked Nov 27, 2019 alecxe 7.5k points
0 votes
1 answer 1.4K views
1.4K views
Problem : The import matplotlib.pyplot as plt is is giving me the error with python2.7, anaconda3. The error shown is as below: ImportError: libGL.so.1: cannot open shared object file: No such file or directory The Detailed Error report is as below : Traceback ... <module> from PyQt5 import QtCore, QtGui, QtWidgets ImportError: libGL.so.1: cannot open shared object file: No such file or directory
asked Dec 18, 2019 alecxe 7.5k points