[英]How to fix “fatal error: Carbon/Carbon.h: No such file or directory”, when trying to deploy to Heroku - (Django)
I am attempting to deploy a project I made on to Heroku, but when I try to push the project with: 我试图将我所做的项目部署到Heroku,但是当我尝试使用以下方法推送项目时:
git push heroku master
it ends up giving me an error that looks like this: 最终给我一个看起来像这样的错误:
appscript_3x/ext/ae.h:26:10: fatal error: Carbon/Carbon.h: No such file or directory
#include <Carbon/Carbon.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jq3tilcm/appscript/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-dpw2ji3n-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-jq3tilcm/appscript/
! Push rejected, failed to compile Python app.
I've tried searching around for what to do, but I can't find anyone with the same problem and I don't know where to go from here. 我已经尝试过寻找解决方法,但是找不到任何遇到相同问题的人,而且我也不知道从这里去哪里。 Any help would be greatly appreciated.
任何帮助将不胜感激。
I met the same problem as you when git push heroku master
my flask project. 当
git push heroku master
我的flask项目时,我遇到了与您相同的问题。 I'm not sure which package leads to this problem, but it is definitely due to one of over 100 packages. 我不确定哪个程序包会导致此问题,但这绝对是由于100多个程序包之一。
Because I deployed successfully when I used the original requirements.txt
. 因为我使用原始的
requirements.txt
时成功部署。 But heroku declined push several times after I ran pip freeze > requirements.txt
, which added over 100 packages that installed automatically by anaconda. 但是在我运行
pip freeze > requirements.txt
之后,heroku几次拒绝了推送,该添加了anaconda自动安装的100多个软件包。 I removed some packages that cannot be found by heroku, and finally, it showed the same error as you met. 我删除了一些heroku无法找到的软件包,最后,它显示出与您遇到的错误相同的错误。 Then I reset
requirements.txt
to the original version and it worked! 然后,我将
requirements.txt
重置为原始版本,并且成功了!
My suggestion is that only adding the packages that you need and you are familiar with. 我的建议是仅添加您需要并且熟悉的软件包。 Hope this can help you!
希望这可以帮到你!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.