ERROR: Failed to build installable wheels for some pyproject.toml based projects (mysqlclient)
Building wheel for mysqlclient (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for mysqlclient (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [91 lines of output]
C:\Users\Acer\AppData\Local\Temp\pip-build-env-qm2za2yg\overlay\Lib\site-packages\setuptools\config_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: project.license
as a TOML table is deprecated
!!
********************************************************************************
Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).
By 2026-Feb-18, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
corresp(dist, value, root_dir)
C:\Users\Acer\AppData\Local\Temp\pip-build-env-qm2za2yg\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: GNU General Public License (GPL)
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
dist._finalize_license_expression()
C:\Users\Acer\AppData\Local\Temp\pip-build-env-qm2za2yg\overlay\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: GNU General Public License (GPL)
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
self._finalize_license_expression()
# 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']
extra_objects: []
define_macros: [('version_info', (2, 2, 4, 'final', 0)), ('__version__', '2.2.4')]
running bdist_wheel
running build
running build_py
creating build\lib.win-amd64-cpython-313\MySQLdb
copying src\MySQLdb\connections.py -> build\lib.win-amd64-cpython-313\MySQLdb
copying src\MySQLdb\converters.py -> build\lib.win-amd64-cpython-313\MySQLdb
copying src\MySQLdb\cursors.py -> build\lib.win-amd64-cpython-313\MySQLdb
copying src\MySQLdb\release.py -> build\lib.win-amd64-cpython-313\MySQLdb
copying src\MySQLdb\times.py -> build\lib.win-amd64-cpython-313\MySQLdb
copying src\MySQLdb\_exceptions.py -> build\lib.win-amd64-cpython-313\MySQLdb
copying src\MySQLdb\__init__.py -> build\lib.win-amd64-cpython-313\MySQLdb
creating build\lib.win-amd64-cpython-313\MySQLdb\constants
copying src\MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-cpython-313\MySQLdb\constants
copying src\MySQLdb\constants\CR.py -> build\lib.win-amd64-cpython-313\MySQLdb\constants
copying src\MySQLdb\constants\ER.py -> build\lib.win-amd64-cpython-313\MySQLdb\constants
copying src\MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-cpython-313\MySQLdb\constants
copying src\MySQLdb\constants\FLAG.py -> build\lib.win-amd64-cpython-313\MySQLdb\constants
copying src\MySQLdb\constants\__init__.py -> build\lib.win-amd64-cpython-313\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-313\MySQLdb
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win-amd64-cpython-313\Release\src\MySQLdb
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD "-Dversion_info=(2, 2, 4, 'final', 0)" -D__version__=2.2.4 -IC:/mariadb-connector\include\mariadb -IC:/mariadb-connector\include -IC:\Users\Acer\AppData\Local\Programs\Python\Python313\include -IC:\Users\Acer\AppData\Local\Programs\Python\Python313\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files\MySQL\MySQL Server 8.0\include" /Tcsrc/MySQLdb/_mysql.c /Fobuild\temp.win-amd64-cpython-313\Release\src\MySQLdb\_mysql.obj
_mysql.c
src/MySQLdb/_mysql.c(314): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
src/MySQLdb/_mysql.c(978): warning C4244: 'function': conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data
src/MySQLdb/_mysql.c(983): warning C4244: 'function': conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data
src/MySQLdb/_mysql.c(1052): warning C4244: 'function': conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data
src/MySQLdb/_mysql.c(1057): warning C4244: 'function': conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data
src/MySQLdb/_mysql.c(1510): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data
src/MySQLdb/_mysql.c(1846): warning C4244: 'function': conversion from 'SOCKET' to 'long', possible loss of data
src/MySQLdb/_mysql.c(1939): warning C4244: 'function': conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data
src/MySQLdb/_mysql.c(1963): warning C4244: 'function': conversion from 'Py_ssize_t' to 'unsigned long', possible loss of data
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\link.exe"
/nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:/mariadb-connector\lib\mariadb /LIBPATH:C:/mariadb-connector\lib /LIBPATH:C:\Users\Acer\AppData\Local\Programs\Python\Python313\libs /LIBPATH:C:\Users\Acer\AppData\Local\Programs\Python\Python313 /LIBPATH:C:\Users\Acer\AppData\Local\Programs\Python\Python313\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.26100.0\um\x64" "/LIBPATH:C:\Program Files\MySQL\MySQL Server 8.0\lib" kernel32.lib advapi32.lib wsock32.lib shlwapi.lib Ws2_32.lib crypt32.lib secur32.lib bcrypt.lib mariadbclient.lib /EXPORT:PyInit__mysql build\temp.win-amd64-cpython-313\Release\src\MySQLdb_mysql.obj /OUT:build\lib.win-amd64-cpython-313\MySQLdb_mysql.cp313-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-313\Release\src\MySQLdb_mysql.cp313-win_amd64.lib /MANIFEST LINK : fatal error LNK1181: cannot open input file 'mariadbclient.lib' error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\link.exe' failed with exit code 1181 [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)
The error occurs because the linker cannot find mariadbclient.lib during the build. To fix this, either install a precompiled mysqlclient wheel matching your Python version, ensure the MariaDB Connector/C is properly installed with the correct library files and paths, or switch to using pymysql, which requires no compilation.