当我尝试使用依赖项文件要求推动更新的烧瓶web应用程序时。我看到它在本地目录中寻找文件,但找不到它。我使用Windows机器。
Running setup.py install for pyodbc: started
remote: Running setup.py install for pyodbc: finished with status 'error'
remote: Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-D6Ujo7/pyodbc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hvSYGE-record/install-record.txt --single-version-externally-managed --compile:
remote: running install
remote: running build
remote: running build_ext
remote: building 'pyodbc' extension
remote: creating build
remote: creating build/temp.linux-x86_64-2.7
remote: creating build/temp.linux-x86_64-2.7/src
remote: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYODBC_VERSION=4.0.16 -DSQL_WCHART_CONVERT=1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -I/app/.heroku/python/include/python2.7 -c src/textenc.cpp -o build/temp.linux-x86_64-2.7/src/textenc.o -Wno-write-strings
remote: cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
remote: In file included from src/textenc.cpp:2:0:
remote: src/pyodbc.h:56:17: fatal error: sql.h: No such file or directory
remote: #include <sql.h>
remote: ^
remote: compilation terminated.
remote: error: command 'gcc' failed with exit status 1
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-D6Ujo7/pyodbc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hvSYGE-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-D6Ujo7/pyodbc/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to data-robot.
remote:
To https://git.heroku.com/data-robot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/data-robot.git'
在输出的第一行中,它告诉您它正在尝试构建pyodbc,这是python围绕ODBC的包装。为此,需要SQL.H文件,该文件定义了一堆函数&amp;通过ODBC访问数据库的类型。
该文件不在您的构建路径中,因此在抱怨。SQL.H通常是Windows SDK的一部分,因此请检查是否有。SDK通常在
c: program Files(x86) Microsoft SDKS Windows Windows V X 。
如果您没有安装SDK,则可以从Microsoft免费下载(免费)。