Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python web app Heroku推送依赖项错误-sql.h:没有这样的文件或目录_Python_Heroku_Flask - Fatal编程技术网

Python web app Heroku推送依赖项错误-sql.h:没有这样的文件或目录

Python web app Heroku推送依赖项错误-sql.h:没有这样的文件或目录,python,heroku,flask,Python,Heroku,Flask,当我尝试使用dependencies file requirements.txt推送更新后的Flask web应用程序时,我收到以下消息,这让我很困惑哪里有错误。我看到它在本地目录中查找文件,但没有找到。我使用Windows机器 Running setup.py install for pyodbc: started remote: Running setup.py install for pyodbc: finished with status 'erro

当我尝试使用dependencies file requirements.txt推送更新后的Flask 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('\r\n', '\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('\r\n', '\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运行setup.py安装:已启动
远程:运行pyodbc的setup.py安装:已完成,状态为“错误”
远程:从命令/app/.heroku/python/bin/python-u-c“导入setuptools,tokenize;uuu文件uuu=”/tmp/pip-build-D6Ujo7/pyodbc/setup.py';f=getattr(tokenize,'open',open)(uu文件uu);code=f.read().replace('\r\n','n');f.close();exec(compile,'code,'uu文件‘,'exec')”install--record/tmp/pip hvSYGE record/install-record.txt--外部管理的单一版本--编译:
远程:正在运行安装
远程:正在运行构建
远程:运行build\u ext
远程:生成“pyodbc”扩展
远程:创建生成
远程:创建build/temp.linux-x86_64-2.7
远程:创建build/temp.linux-x86_64-2.7/src
远程:gcc-pthread-fno严格别名-g-O2-DNDEBUG-g-fwrapv-O3-Wall-Wstrict原型-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/python2.7-c src/textenc.cpp-obuild/temp.linux-x86_64-2.7/src/textenc.o-Wno写字符串
远程:Cc1Pult:警告:命令行选项'WrimeTrimeType '对于C/Objc有效,但不适用于C++ [默认启用]
远程:在src/textenc.cpp:2:0中包含的文件中:
remote:src/pyodbc.h:56:17:致命错误:sql.h:没有这样的文件或目录
远程:#包括
远程:^
远程:编译已终止。
远程:错误:命令“gcc”失败,退出状态为1
远程:
远程:----------------------------------------
远程:命令“/app/.heroku/python/bin/python-u-c”导入setuptools,标记化__文件_uu='/tmp/pip-build-D6Ujo7/pyodbc/setup.py';f=getattr(标记化“打开”,打开)(_文件);code=f.read().replace('\r\n','\n');f、 close();exec(compile(code,_u文件,_u,'exec'))“安装--record/tmp/pip hvsyce record/install-record.txt--外部管理的单一版本--compile”失败,错误代码为/tmp/pip-build-D6Ujo7/pyodbc中的1/
遥控器:!推送被拒绝,未能编译Python应用程序。
远程:
遥控器:!推送失败
远程:正在验证部署。。。
远程:
遥控器:!推送到数据机器人。
远程:
到https://git.heroku.com/data-robot.git
! [远程拒绝]主机->主机(拒绝预接收挂钩)
错误:无法将某些引用推送到'https://git.heroku.com/data-robot.git'

在输出的第一行,它告诉您它正在尝试构建pyodbc,这是python围绕odbc的包装。为此,需要sql.h文件,该文件定义了一系列用于通过odbc访问数据库的函数和类型。
该文件不在您的构建路径中,因此它正在抱怨。h通常是windows sdk的一部分,所以请检查您是否有。sdk通常在

C:\ProgramFiles(x86)\Microsoft SDK\Windows\vx.y\include


如果您没有安装sdk,可以从Microsoft(免费)下载它。

Heroku上没有Windows sdk,我会惊讶地发现Microsoft提供了一个可以在那里运行的sdk。Mari声称他是在Windows上构建的……OP的本地机器是Windows机器。然而,构建发生在Heroku上。
sql.h
是否存在于本地并不重要。我想我应该先检查一下heroku是什么。不管怎样,看到了吗