pip install mysqlclient returns “fatal error C1083: Cannot open file: ‘mysql.h’: No such file or directory

You can download unofficial windows binaries for your python version using https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient. Then install it using pip. This way you’ll be able to avoid the hassle of dealing with visual studio build tools.

Just download the mysqlclient.whl file most applicable to you. I think in your case it’ll be

mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl

and run

pip install "path to the downloaded .whl file"

Leave a Comment