src/MySQLdb/_mysql.c(29):致命错误C1083:无法打开包含文件:'mysql. h':没有这样的文件或目录

9lowa7mx  于 2023-11-16  发布在  Mysql
关注(0)|答案(1)|浏览(193)

尝试pip install mysqlclient时出现此错误
最新版本的Windows 11 22621
为收集的包构建轮子:mysqlclient为mysqlclient构建轮子(pyproject.toml). error error:subprocess-exited-with-error
× Building wheel for mysqlclient(pyproject.toml)未成功运行。请返回退出代码:1 ─>[46行输出]#构建扩展模块的选项:library_dirs:'C:/mariadb-connector\lib\mariadb','C:/mariadb-connector\lib']库:请输入'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,0,'final',0)),('*版本 * 号','2.2.0')]运行bdist_wheel运行build运行build_py创建build创建build\lib. win-amd64-cpython-312创建build\lib. win-amd64-cpython-312\MySQLdb复制src\MySQLdb\connections.py-> build\lib. win-amd64-cpython-312\MySQLdb复制src\MySQLdb\converters.py-> build\lib. win-amd64-cpython-312\MySQLdb复制src\MySQLdb\cursors.py-> build\lib. win-amd64-cpython-312\MySQLdb复制src\MySQLdb\release.py-> build\lib. win-amd64-cpython-312\MySQLdb复制src\MySQLdb\times.py-> build\lib. win-amd64-cpython-312\MySQLdb复制src\MySQLdb_exceptions. py-> build\lib. win-amd64-cpython-312\MySQLdb复制src\MySQLdb_ init . py-> build\lib. win-amd64-cpython-312\MySQLdb创建build\lib. win-amd64-cpython-312\MySQLdb\常量复制src\MySQLdb\常量\CLIENT.py-> build\lib. win-amd64-cpython-312\MySQLdb\常量复制src\MySQLdb\constants\CR.py-> build\lib. win-amd64-cpython-312\MySQLdb\constants copying src\MySQLdb\constants\ER.py-> build\lib. win-amd64-cpython-312\MySQLdb\constants copying src\MySQLdb\constants\FIELD_TYPE. py-> build\lib. win-amd64-cpython-312\MySQLdb\constants copying src\MySQLdb\constants\FLAG.py-> build\lib. win-amd64-cpython-312\MySQLdb\constants copying src\MySQLdb\constants init *. py-> build\lib. win-amd64-cpython-312\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阅读manifest file 'src\mysqlclient. egg-info\阅读清单模板MANIFEST.in添加许可证文件LICENSE写入清单文件src\mysqlclient.egg-info\SOURCES.txt复制src\MySQLdb_mysql. c-> build\lib. win-amd 64-cpython-312\MySQLdb运行build_ext building 'MySQLdb. * mysql'扩展创建build\temp. win-amd64-cpython-312创建build\temp. win-amd64-cpython-312\Release创建build\temp. win-amd64-cpython-312\Release\src创建build\temp. win-amd64-cpython-312\Release\src\MySQLdb "C:\Program Files(x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe "/c/nologo/O2/W3/GL/DNDEBUG/MD "-Dversion_info =(2,2,0,'final',0)"-D__version *= 2.2.0-IC:/mariadb-connector\include\mariadb-IC:/mariadb-connector\include-IC:\Users\Adnan\AppData\Local\Programs\Python\Python312\include-IC:\Users\Adnan\AppData\Local\Programs\Python\Python312\Include"-IC:\Program Files(x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include ""-IC:\Program Files(x86)\Microsoft Visual Studio\2022\BuildTools\VC\Buililiary\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:\程序文件(x86)\Windows Kits\10\include\10.0.22621.0\shared ""-IC:\程序文件(x86)\Windows Kits\10\include\10.0.22621.0\winrt ""-IC:\程序文件(x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt "/Tcsrc/MySQLdb/_mysql. c/Fobuild\temp. win-amd64-cpython-312\Release\src/MySQLdb/_mysql. obj_mysql. c src/MySQLdb/_mysql. c(29):致命错误C1083:无法打开包含文件:'mysql.h ':没有这样的文件或目录错误:命令' C:\Program Files(x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe "失败,退出代码为2 [输出结束]
注:此错误源于子进程,可能不是pip的问题。错误:为mysqlclient构建wheel失败无法构建mysqlclient错误:无法为mysqlclient构建wheel,这是安装pyproject所必需的。
我已经试过答案了。pip install mysqlclient returns "fatal error C1083: Cannot open file: 'mysql.h': No such file or directory

qnzebej0

qnzebej01#

返回到python 3.11版本直到bug被修复

相关问题