Fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory

  running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-312
      creating build\lib.win-amd64-cpython-312\MySQLdb
      copying MySQLdb\__init__.py -> build\lib.win-amd64-cpython-312\MySQLdb
      copying MySQLdb\_exceptions.py -> build\lib.win-amd64-cpython-312\MySQLdb
      copying MySQLdb\connections.py -> build\lib.win-amd64-cpython-312\MySQLdb
      copying MySQLdb\converters.py -> build\lib.win-amd64-cpython-312\MySQLdb
      copying MySQLdb\cursors.py -> build\lib.win-amd64-cpython-312\MySQLdb
      copying MySQLdb\release.py -> build\lib.win-amd64-cpython-312\MySQLdb
      copying MySQLdb\times.py -> build\lib.win-amd64-cpython-312\MySQLdb
      creating build\lib.win-amd64-cpython-312\MySQLdb\constants
      copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-cpython-312\MySQLdb\constants
      copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-cpython-312\MySQLdb\constants
      copying MySQLdb\constants\CR.py -> build\lib.win-amd64-cpython-312\MySQLdb\constants
      copying MySQLdb\constants\ER.py -> build\lib.win-amd64-cpython-312\MySQLdb\constants
      copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-cpython-312\MySQLdb\constants
      copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-cpython-312\MySQLdb\constants
      running build_ext
      building 'MySQLdb._mysql' extension
      creating build\temp.win-amd64-cpython-312
      creating build\temp.win-amd64-cpython-312\Release
      creating build\temp.win-amd64-cpython-312\Release\MySQLdb
      "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 "-IC:\Program Files\MariaDB\MariaDB Connector C\include\mariadb" "-IC:\Program Files\MariaDB\MariaDB Connector C\include" -ID:\python\ewp_django_backend\venv\include -IC:\Users\USER\AppData\Local\Programs\Python\Python312\include -IC:\Users\USER\AppData\Local\Programs\Python\Python312\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win-amd64-cpython-312\Release\MySQLdb/_mysql.obj
      _mysql.c
      MySQLdb/_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\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

  ERROR: Failed building wheel for mysqlclient
Failed to build backports.zoneinfo mysqlclient
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (backports.zoneinfo, mysqlclient)

I moved the sql file to programfilex86 still the error is not resolving please help

Back to Top