pip安装pyodbc失败

时间:2020-05-25 16:05:36

标签: python pip pyodbc

我正在尝试在使用lambci / lambda:build-python3.8映像启动的Docker容器中安装pyodbc。

命令:pip install pyodbc

我收到以下错误消息。

bash-4.2# pip 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: /var/lang/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/p
ip-install-vp296l1s/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vp296l1s/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-_0gnru3p
       cwd: /tmp/pip-install-vp296l1s/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
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=
4.0.30 -I/var/lang/include/python3.8 -c src/buffer.cpp -o build/temp.linux-x86_64-3.8/src/buffer.o -Wn
o-write-strings
  In file included from src/buffer.cpp:12:0:
  src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
   #include <sql.h>
            ^~~~~~~
  compilation terminated.

有人可以告诉我如何解决这个问题。

0 个答案:

没有答案