[英]Cannot install pyodbc, missing header files, command prompt: fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
I'm trying to install pyodbc for python 3.9.2 (32-bit), however I keep getting the error:我正在尝试为 python 3.9.2(32 位)安装 pyodbc,但我不断收到错误消息:
C:\Users\ICAPP02\AppData\Local\Temp\pip-install-0c78okb8\pyodbc_d782ffa5512448c49f83e214e7ec4434\src\pyodbc.h(19): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\cl.exe' failed with exit code 2 C:\Users\ICAPP02\AppData\Local\Temp\pip-install-0c78okb8\pyodbc_d782ffa5512448c49f83e214e7ec4434\src\pyodbc.h(19): 致命错误 C1083: 无法打开包含文件: 'windows.h': 没有这样的文件或目录错误:命令“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\cl.exe”失败,退出代码为 2
I understand I am missing the windows.h C++ header files, but I genuinely cant find them, no longer know where to look, know how many I am missing, or know how they look like.我知道我丢失了 windows.h C++ header 文件,但我真的找不到它们,不再知道去哪里找,不知道我丢失了多少,也不知道它们是什么样子。
Also when I do locate them, do I place them in the folder that is referenced in the error?: C:\Program Files (x86)\Microsoft VisualStudio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x86\cl.exe另外,当我找到它们时,是否将它们放在错误中引用的文件夹中?:C:\Program Files (x86)\Microsoft VisualStudio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\ HostX86\x86\cl.exe
I added a photo of the Visual Studio package I downloaded, perhaps I downloaded the wrong package...我添加了我下载的Visual Studio package的照片,也许我下载错了package ...
For some reason the latest version of pyodbc built a Python 3.9 wheel for 64-bit but not for 32-bit.出于某种原因,最新版本的 pyodbc 为 64 位而不是 32 位构建了 Python 3.9 轮。 However, you can get the 32-bit wheel here:
但是,您可以在此处获得 32 位轮:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc
You can also just install the windows sdk, for your particular windows version, to resolve this issue您也可以只安装 windows sdk,针对您特定的 windows 版本,以解决此问题
https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.