简体   繁体   中英

Heroku: Failed to git push

Hi I am attempting to git push my python app, but constantly obtain error messages. This is the best that I can do so far. Errors below:

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

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

I think I did, in my best knowledge. But did you see what would I have missed? I have a huge list of requirements.txt ( ~40 dependencies). Most of them are not used in my app. They are there because I pip freeze > requirements.txt Would this huge list cause the problem?

Thank you.

I had a really similar error message to this when deploying from Windows OS to Heroku, while this may not help everyone for me it actually turned out to be a simple fix.

In requirements.txt I removed packages that are not necessary for linux.

In my case removing

winkerberos

which was pip installed for windows support alongside

requests-kerberos

which fixed the issue.

If you can try pip freeze on a linux machine I would recommend this instead, to avoid error messages for missing windows C .h header files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM