Julian Avila
Julian Avila

Reputation: 115

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:

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

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.

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

I added a photo of the Visual Studio package I downloaded, perhaps I downloaded the wrong package...

Upvotes: 6

Views: 2413

Answers (2)

David
David

Reputation: 4083

You can also just install the windows sdk, for your particular windows version, to resolve this issue

https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/

Upvotes: 0

Gord Thompson
Gord Thompson

Reputation: 123484

For some reason the latest version of pyodbc built a Python 3.9 wheel for 64-bit but not for 32-bit. However, you can get the 32-bit wheel here:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc

Upvotes: 5

Related Questions