• Register
0 votes
2.9k 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

Please log in or register to answer this question.

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.
I followed all your instructions but it wont work me

Related questions

0 votes
1 answer 15 views
15 views
Problem; HELP! I need help understanding this error and why it still happened to me : Fatal error c1083: cannot open include file: 'mysql.h': no such file or directory.
asked Mar 6 Wafa Abu Yousef 6.1k points
1 vote
1 answer 7 views
7 views
Problem: I am facing this fatalerror. Do not know why? Fatal error: adafruit_sensor.h: no such file or directory.
asked Mar 24 PkGuy 13.1k points
0 votes
1 answer 2 views
2 views
problem: please help to solve fatal error c1083: cannot open include file: 'config-win.h': no such file or directory.
asked 1 day ago ashik 11.2k points
1 vote
1 answer 607 views
607 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
0 votes
1 answer 5 views
5 views
Problem: I am working on a program and faced this error. A fatal mysql error was encountered.
asked Mar 24 PkGuy 13.1k points
0 votes
1 answer 43 views
43 views
Problem: any help : Python: can't open file 'get-pip.py': [errno 2] no such file or directory.
asked Mar 6 Wafa Abu Yousef 6.1k points
2 votes
1 answer 3.7K views
3.7K 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, 2020 samhaz 5k points
0 votes
1 answer 2K views
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 34 views
34 views
I am trying to build a shared library using a C extension file but first I have to generate the output file using the command below: gcc -Wall utilsmodule.c -o Utilc After executing the command, I get this error message: > utilsmodule.c:1:20: fatal error: ... solutions over the internet but the problem still exists. I have no problem with Python.h. I managed to locate the file on my machine.
asked Oct 25, 2020 psandprop 2.4k points
0 votes
1 answer 27 views
27 views
Problem: fatal error: openssl/opensslv.h: no such file or directory
asked Feb 18 charles mathews 5.5k points