src / pyodbc.h:56:17:致命错误:sql.h:没有此类文件或目录

时间:2019-07-24 23:10:23

标签: pyodbc

尝试使用apc创建应用程序,但收到以下错误消息“ src / pyodbc.h:56:17:致命错误:sql.h:没有此类文件或目录”。看起来我需要在安装了Apcera平台的服务器上安装unixodbc-dev,但不确定如何安装。使用Docker,我可以在dockerfile中添加“ apt-get install unixodbc-dev”,因此至少在制作docker映像时我看不到这种错误。您是否知道如何使用pyodbc解决此错误? (我几天前在“ python”标签中添加了问题,但看起来“服务器”似乎是更新我的问题的好地方)。以下是我的完整日志。

'''
$ apc app create
Warning: Cygwin is not supported; some features may not work as intended.
Packaging... done
Creating package "case-app"... done
Uploading package contents... done!
[package] -- Uploading -- received all bytes from client, start upload to storage backend
[package] -- Uploading -- uploaded resource "0958307c-1b57-4b17-892d-828779a69734" to storage backend successfully in 1.103s
[package] -- Uploading -- updated package "f332f4d7-b7b8-42ae-8088-89ad50a289b6" with new resource

[staging] Subscribing to the staging process...
[staging] Located application manifest
[staging]  Beginning staging with 'stagpipe::/apcera::python' pipeline, 1 stager(s) defined.
[staging]  Launching instance of stager 'python'...
[staging]  Downloading package for processing...
[staging]  Stager needs relaunching
[staging]  Launching instance of stager 'python'...
[staging]  Downloading package for processing...
[staging]  Using Python 3.5.1
[staging] Found 'requirements.txt'.
[staging] Executing 'pip install'...
[staging]  You are using pip version 6.0.8, however version 19.2.1 is available.
[staging] You should consider upgrading via the 'pip install --upgrade pip' command.
[staging]  Collecting Django==2.2.3 (from -r requirements.txt (line 1))
[staging]    Downloading https://files.pythonhosted.org/packages/39/b0/2138c31bf13e17afc32277239da53e9dfcce27bac8cb68cf1c0123f1fdf5/Django-2.2.3-py3-none-any.whl (7.5MB)
[staging]  Collecting mysqlclient==1.4.2.post1 (from -r requirements.txt (line 2))
[staging]    Downloading https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz (85kB)
[staging]      /opt/apcera/python-3.5.1/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
[staging]       warnings.warn(msg)
[staging] Collecting pyodbc (from -r requirements.txt (line 3))
[staging]    Downloading https://files.pythonhosted.org/packages/b4/41/f3eb5e56af207a8fcc02f1f84cc3fed9fcf315565e65f418ae815e399929/pyodbc-4.0.26.tar.gz (219kB)
[staging]  Collecting setuptools==41.0.1 (from -r requirements.txt (line 4))
[staging]    Downloading https://files.pythonhosted.org/packages/ec/51/f45cea425fd5cb0b0380f5b0f048ebc1da5b417e48d304838c02d6288a1e/setuptools-41.0.1-py2.py3-none-any.whl (575kB)
[staging]  Collecting gunicorn (from -r requirements.txt (line 5))
[staging]    Downloading https://files.pythonhosted.org/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl (112kB)
[staging] Collecting sqlparse (from Django==2.2.3->-r requirements.txt (line 1))
[staging]    Downloading https://files.pythonhosted.org/packages/ef/53/900f7d2a54557c6a37886585a91336520e5539e3ae2423ff1102daf4f3a7/sqlparse-0.3.0-py2.py3-none-any.whl
[staging] Collecting pytz (from Django==2.2.3->-r requirements.txt (line 1))
[staging]    Downloading https://files.pythonhosted.org/packages/3d/73/fe30c2daaaa0713420d0382b16fbb761409f532c56bdcc514bf7b6262bb6/pytz-2019.1-py2.py3-none-any.whl (510kB)
[staging]  Installing collected packages: pytz, sqlparse, gunicorn, setuptools, pyodbc, mysqlclient, Django
[staging]
[staging]
[staging]
[staging]   Found existing installation: setuptools 12.0.5
[staging]      Uninstalling setuptools-12.0.5:
[staging]        Successfully uninstalled setuptools-12.0.5
[staging]
[staging]    Running setup.py install for pyodbc
[staging]      building 'pyodbc' extension
[staging]     gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYODBC_VERSION=4.0.26 -I/opt/apcera/python-3.5.1/include/python3.5m -c src/buffer.cpp -o build/temp.linux-x86_64-3.5/src/buffer.o -Wno-write-strings
[staging]     cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ [enabled by default]
[staging]     In file included from src/buffer.cpp:12:0:
[staging]     src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
[staging]      #include <sql.h>
[staging]                      ^
[staging]     compilation terminated.
[staging]     error: command 'gcc' failed with exit status 1
[staging]     Complete output from command /app/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-x65_69m2/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_yh1njl3-record/install-record.txt --single-version-externally-managed --compile --install-headers /app/include/site/python3.5:
[staging]     running install
[staging]
[staging]     running build
[staging]
[staging]     running build_ext
[staging]
[staging]     building 'pyodbc' extension
[staging]
[staging]     creating build
[staging]
[staging]     creating build/temp.linux-x86_64-3.5
[staging]
[staging]     creating build/temp.linux-x86_64-3.5/src
[staging]
[staging]     gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYODBC_VERSION=4.0.26 -I/opt/apcera/python-3.5.1/include/python3.5m -c src/buffer.cpp -o build/temp.linux-x86_64-3.5/src/buffer.o -Wno-write-strings
[staging]
[staging]     cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ [enabled by default]
[staging]
[staging]     In file included from src/buffer.cpp:12:0:
[staging]
[staging]     src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
[staging]
[staging]      #include <sql.h>
[staging]
[staging]                      ^
[staging]
[staging]     compilation terminated.
[staging]
[staging]     error: command 'gcc' failed with exit status 1
[staging]
[staging]     ----------------------------------------
[staging]      Command "/app/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-x65_69m2/pyodbc/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-_yh1njl3-record/install-record.txt --single-version-externally-managed --compile --install-headers /app/include/site/python3.5" failed with error code 1 in /tmp/pip-build-x65_69m2/pyodbc
[staging]  Please try staging again.
[staging]  Encountered error while running 'pip install'.
[staging]  Staging pipeline has been aborted
[staging] "package::/runq/sandbox/yjunlee::case-app" has failed to stage
Package "case-app" deleted

Could not clean up package "case-app": Package not found in database
Error: error uploading new package: Staging has failed.
Try `apc help` for more information.
'''

0 个答案:

没有答案