0

I'm trying to install mysqldb on python3.8 (Windows 11 24H2).

I initially had issues with VSC++14 but I managed to solve them.

pip install -U flask_mysqldb error: subprocess-exited-with-error × Building wheel for mysqlclient (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [41 lines of output] # Options for building extension module: library_dirs: ['C:/mariadb-connector\\lib\\mariadb', 'C:/mariadb-connector\\lib'] libraries: ['kernel32', 'advapi32', 'wsock32', 'shlwapi', 'Ws2_32', 'crypt32', 'secur32', 'bcrypt', 'mariadbclient'] extra_link_args: ['/MANIFEST'] include_dirs: ['C:/mariadb-connector\\include\\mariadb', 'C:/mariadb-connector\\include\\mysql', 'C:/mariadb-connector\\include'] extra_objects: [] define_macros: [('version_info', (2, 2, 7, 'final', 0)), ('__version__', '2.2.7')] running bdist_wheel running build running build_py creating build\lib.win-amd64-cpython-38\MySQLdb copying src\MySQLdb\connections.py -> build\lib.win-amd64-cpython-38\MySQLdb copying src\MySQLdb\converters.py -> build\lib.win-amd64-cpython-38\MySQLdb copying src\MySQLdb\cursors.py -> build\lib.win-amd64-cpython-38\MySQLdb copying src\MySQLdb\release.py -> build\lib.win-amd64-cpython-38\MySQLdb copying src\MySQLdb\times.py -> build\lib.win-amd64-cpython-38\MySQLdb copying src\MySQLdb\_exceptions.py -> build\lib.win-amd64-cpython-38\MySQLdb copying src\MySQLdb\__init__.py -> build\lib.win-amd64-cpython-38\MySQLdb creating build\lib.win-amd64-cpython-38\MySQLdb\constants copying src\MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-cpython-38\MySQLdb\constants copying src\MySQLdb\constants\CR.py -> build\lib.win-amd64-cpython-38\MySQLdb\constants copying src\MySQLdb\constants\ER.py -> build\lib.win-amd64-cpython-38\MySQLdb\constants copying src\MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-cpython-38\MySQLdb\constants copying src\MySQLdb\constants\FLAG.py -> build\lib.win-amd64-cpython-38\MySQLdb\constants copying src\MySQLdb\constants\__init__.py -> build\lib.win-amd64-cpython-38\MySQLdb\constants running egg_info writing src\mysqlclient.egg-info\PKG-INFO writing dependency_links to src\mysqlclient.egg-info\dependency_links.txt writing top-level names to src\mysqlclient.egg-info\top_level.txt reading manifest file 'src\mysqlclient.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'src\mysqlclient.egg-info\SOURCES.txt' copying src\MySQLdb\_mysql.c -> build\lib.win-amd64-cpython-38\MySQLdb running build_ext building 'MySQLdb._mysql' extension creating build\temp.win-amd64-cpython-38\Release\src\MySQLdb "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-Dversion_info=(2, 2, 7, 'final', 0)" -D__version__=2.2.7 -IC:/mariadb-connector\include\mariadb -IC:/mariadb-connector\include\mysql -IC:/mariadb-connector\include "-Ic:\program files\python38\include" "-Ic:\program files\python38\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.43.34808\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tcsrc/MySQLdb/_mysql.c /Fobuild\temp.win-amd64-cpython-38\Release\src/MySQLdb/_mysql.obj _mysql.c src/MySQLdb/_mysql.c(29): fatal error C1083: Impossible d'ouvrir le fichier includeÿ: 'mysql.h'ÿ: No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.43.34808\\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 mysqlclient ERROR: Failed to build installable wheels for some pyproject.toml based projects (mysqlclient) 

I have no idea what's the origin of this.

Anyone know how to solve this??

3
  • This question is similar to: pip install mysqlclient returns "fatal error C1083: Cannot open file: 'mysql.h': No such file or directory. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented May 13 at 12:07
  • That related post I just shared talks about installing mysqlclient. Installing flask_mysqldb also requires mysqlclient (as shown in the error message), so it's the same error and the answers there might work the same for you. Commented May 13 at 12:11
  • The PyPi page for flask-mysqldb says the same thing pypi.org/project/Flask-MySQLdb: "First, you may need to install some dependencies for mysqlclient if you don't already have them, see here" Commented May 13 at 12:15

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.