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

7.5k 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 !!

 

38.6k 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 82 views
82 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
0 votes
1 answer 303 views
303 views
Problem: I have been trying to install Scrapy for Python for the last couple of days. Trying anything i could think off and read everything i have come across with similar problems, but haven't been able to find a solution. So here is the code. Thank you. building ' ... code 1 in C:\Users\KARLHO~1\AppData\Local\Temp\pip-build-ylmjilcy\Twisted\ edit - the code i have used is "pip install Scrapy"
asked Apr 26 sumaiya simi 43.9k points
1 vote
1 answer 22 views
22 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 25.9k points
0 votes
1 answer 28 views
28 views
problem: please help to solve fatal error c1083: cannot open include file: 'config-win.h': no such file or directory.
asked Apr 11 ashik 14.6k points
1 vote
1 answer 873 views
873 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 30 views
30 views
Problem: I am using visual studio community 2017, and I am tryying to build ninja from developer command prompt . Every time I try exception is thrown fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory . I referred some other sites ... 10 SDK (10.0.17763.0) 4) Windows Universal CRT SDK Kindly suggest some solution for this ? Am I missing any dependency packages?
asked Apr 26 Yeamin 23.5k points
0 votes
1 answer 4 views
4 views
Problem: Fatal error: ffi.h: no such file or directory.
asked Jul 7 Florina Gulnar 106k points
1 vote
1 answer 47 views
47 views
Problem: Please help to resolve this error: Fatal error: libpq-fe.h: no such file or directory.
asked May 20 PkGuy 25.9k points
1 vote
1 answer 13 views
13 views
Problem: How to figure out this fatal error? Fatal error: iostream.h: no such file or directory
asked May 20 PkGuy 25.9k points
0 votes
1 answer 41 views
41 views
Problem: when trying to install pyOpenSSL, pip states that it cannot find file 'ffi.h'. I know both thatffi.h exists as well as its directory, so how do I go about closing this gap between ffi.h and pip?
asked Apr 21 ummesalma 29.1k points