pip install mysqlclient failed: fatal error: sys/types.h: no such file or directory...command 'gcc' failed with exit status 1
I was creating engine for mysql using sqlalchemy. Got an error "ImportError: No module named MySQLdb". Then I tried to pip install mysqlclient but got this problem. Based on my research sys/types.h is supposed to be found in /usr/include/sys but I don't have include folder in /usr. Tried brew install mysql-connector-c which succeed but didn't fix the problem.
I'm on macOS Mojave(V10.14)
The following command is proposed in many places, but the latest version does not install header files.
$ xcode-select --install
So, you need to execute the following command to install those headers as well:
$ sudo /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With