Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I am installing pyodbc using command propmpt for sql server it returns following error. #639

Closed
niranjan0k opened this issue Oct 30, 2019 · 5 comments

Comments

@niranjan0k
Copy link

When trying to install pyodbc using pip I get this error:

ERROR: Command errored out with exit status 1:
 command: 'c:\users\pc1\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pc1\\AppData\\Local\\Temp\\pip-install-oll6gnwp\\pyodbc\\setup.py'"'"'; __file__='"'"'C:\\Users\\pc1\\AppData\\Local\\Temp\\pip-install-oll6gnwp\\pyodbc\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\pc1\AppData\Local\Temp\pip-record-_plp0xxd\install-record.txt' --single-version-externally-managed --compile
     cwd: C:\Users\pc1\AppData\Local\Temp\pip-install-oll6gnwp\pyodbc\
Complete output (12 lines):
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
creating build\temp.win-amd64-3.8\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYODBC_VERSION=4.0.27 -Ic:\users\pc1\appdata\local\programs\python\python38\include -Ic:\users\pc1\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /EHsc /Tpsrc\buffer.cpp /Fobuild\temp.win-amd64-3.8\Release\src\buffer.obj /Wall /wd4514 /wd4820 /wd4668 /wd4711 /wd4100 /wd4127 /wd4191
buffer.cpp
C:\Users\pc1\AppData\Local\Temp\pip-install-oll6gnwp\pyodbc\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\\Enterprise\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\users\pc1\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\pc1\AppData\Local\Temp\pip-install-oll6gnwp\pyodbc\setup.py'"'"'; file='"'"'C:\Users\pc1\AppData\Local\Temp\pip-install-oll6gnwp\pyodbc\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\pc1\AppData\Local\Temp\pip-record-_plp0xxd\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

@v-chojas
Copy link
Contributor

C1083: Cannot open include file: 'windows.h': No such file or directory

Do you have Windows SDK installed?

@gordthompson
Copy link
Collaborator

Duplicate of #638

@niranjan0k
Copy link
Author

C1083: Cannot open include file: 'windows.h': No such file or directory

Do you have Windows SDK installed?

No, I was not installed window SDK. but now I have install windows SDK and it works
Thank for that.

@garykuipers
Copy link

Hi there, can I get some help on the linux version of this? Appears to be missing sql.h

pip3 install pyodbc
Collecting pyodbc
Using cached pyodbc-4.0.30.tar.gz (266 kB)
Building wheels for collected packages: pyodbc
Building wheel for pyodbc (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rvlaat6v/pyodbc/setup.py'"'"'; file='"'"'/tmp/pip-install-rvlaat6v/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-azhnmixi
cwd: /tmp/pip-install-rvlaat6v/pyodbc/
Complete output (14 lines):
running bdist_wheel
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYODBC_VERSION=4.0.30 -I/usr/include/python3.8 -c src/buffer.cpp -o build/temp.linux-x86_64-3.8/src/buffer.o -Wno-write-strings
In file included from src/buffer.cpp:12:
src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
56 | #include <sql.h>
| ^~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

ERROR: Failed building wheel for pyodbc
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rvlaat6v/pyodbc/setup.py'"'"'; file='"'"'/tmp/pip-install-rvlaat6v/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-wlj2nri_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pyodbc
cwd: /tmp/pip-install-rvlaat6v/pyodbc/
Complete output (14 lines):
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYODBC_VERSION=4.0.30 -I/usr/include/python3.8 -c src/buffer.cpp -o build/temp.linux-x86_64-3.8/src/buffer.o -Wno-write-strings
In file included from src/buffer.cpp:12:
src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
56 | #include <sql.h>
| ^~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rvlaat6v/pyodbc/setup.py'"'"'; file='"'"'/tmp/pip-install-rvlaat6v/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-wlj2nri_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pyodbc Check the logs for full command output.

@v-chojas
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants