Python Heroku:git推送失败

Python Heroku:git推送失败,python,git,heroku,deployment,Python,Git,Heroku,Deployment,您好,我正在尝试git推送我的python应用程序,但不断获得错误消息。这是迄今为止我能做的最好的了。错误如下: remote: gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/app/.heroku/minicon

您好,我正在尝试git推送我的python应用程序,但不断获得错误消息。这是迄今为止我能做的最好的了。错误如下:

remote:            gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/app/.heroku/miniconda/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
remote:            c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
remote:             #include <ffi.h>
remote:                             ^
remote:            compilation terminated.
remote:            error: command 'gcc' failed with exit status 1
remote:            
remote:            ----------------------------------------
remote: Command "/app/.heroku/miniconda/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-HrTCjj/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-VNanYj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-HrTCjj/cffi/
remote: You are using pip version 8.1.1, however version 8.1.2 is available.
remote: You should consider upgrading via the 'pip install --upgrade pip' command.
remote: 
remote:  !     Push rejected, failed to compile Python/Conda app
remote: 
remote: Verifying deploy....
remote: 
remote: !   Push rejected to newhapp.
remote: 
To https://git.heroku.com/newhapp.git

$heroku logts --tail 
Slug compilation failed: failed to compile Python/Conda app
remote:gcc-pthread-fno严格别名-g-O2-DNDEBUG-g-fwrapv-O3-Wall-Wstrict原型-fPIC-DUSE_u线程-I/usr/include/ffi-I/usr/include/libffi-I/app/.heroku/miniconda/include/python2.7-c/_cffi_backend.c-o build/temp.linux-x86_64-2.7/c backend/cffi.o
远程:c/_cffi_backend.c:15:17:致命错误:ffi.h:没有这样的文件或目录
远程:#包括
远程:^
远程:编译已终止。
远程:错误:命令“gcc”失败,退出状态为1
远程:
远程:----------------------------------------
远程:命令“/app/.heroku/miniconda/bin/python-u-c”导入setuptools,标记化__文件\ \='/tmp/pip build HrTCjj/cffi/setup.py';exec(compile(getattr(tokenize,'open',open)(_文件_).read().replace('\r\n','\n'),_文件__,'exec'))“install--record/tmp/pip VNanYj record/install-record.txt--single version externally managed--compile”失败,错误代码为/tmp/pip build HrTCjj/cffi中的1/
远程:您使用的是pip版本8.1.1,但版本8.1.2可用。
远程:您应该考虑通过“PIP安装-升级PIP”命令进行升级。
远程:
遥控器:!推送被拒绝,未能编译Python/Conda应用程序
远程:
远程:正在验证部署。。。。
远程:
遥控器:!推送到newhapp。
远程:
到https://git.heroku.com/newhapp.git
$heroku logts——尾巴
Slug编译失败:未能编译Python/Conda应用程序

您是否遵循了heroku教程中的所有步骤(所有步骤)?

据我所知,我想是的。但是你知道我会错过什么吗?我有一个巨大的requirements.txt列表(~40个依赖项)。它们中的大多数都没有在我的应用程序中使用。它们之所以存在,是因为我点击了pip freeze>requirements.txt 这个庞大的清单会导致问题吗


谢谢。

从Windows操作系统部署到Heroku时,我收到了与此类似的错误消息,虽然这可能对我的每个人都没有帮助,但事实证明这只是一个简单的修复

在requirements.txt中,我删除了linux不需要的包

就我而言

winkerberos
为windows支持安装了哪一个pip

requests-kerberos
解决了这个问题


如果您可以在linux机器上尝试pip冻结,我建议您这样做,以避免丢失windows C.h头文件的错误消息。

当我使用$pip--version时,我使用了/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages(Python 2.7)中的pip 8.1.2上面写着
ffi.h:没有这样的文件
我不清楚ffi.h是什么。我怎样才能解决这个问题?如果你没有使用
virtualenv
,那么是的。我发现这是因为我放错了virtualenv,当我停下来的时候,它占据了一切…:)谢谢你的回复,你救了我一天