Home >Database >Mysql Tutorial >How to Fix 'fatal error C1083: Cannot open file 'mysql.h': No such file or directory' When Installing mysqlclient?
Failed to install mysqlclient: error "fatal error C1083: Cannot open file 'mysql.h': No such file or directory"
When installing the mysqlclient library using pip, you may encounter the following error message:
<code>fatal error C1083: Cannot open file: 'mysql.h': No such file or directory</code>
This error is usually caused by a missing mysql.h
header file, which is essential for building the mysqlclient extension.
Solution
To resolve this issue, you can download the unofficial Windows binaries for your version of Python from this website. This method avoids the hassle of using the Visual Studio build tools.
<code>pip install "下载文件的路径"</code>
For example, if you downloaded mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl, you should execute the following command:
<code>pip install mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl</code>
This method should successfully install the mysqlclient library without the above error.
The above is the detailed content of How to Fix 'fatal error C1083: Cannot open file 'mysql.h': No such file or directory' When Installing mysqlclient?. For more information, please follow other related articles on the PHP Chinese website!