尝试部署到Heroku时如何解决“致命错误:Carbon / Carbon.h:没有这样的文件或目录”-(Django) - python

我试图将我所做的项目部署到Heroku,但是当我尝试使用以下方法推送项目时:

git push heroku master

最终给我一个看起来像这样的错误:

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.

我已经尝试过寻找解决方法,但是找不到任何遇到相同问题的人,而且我也不知道从这里去哪里。任何帮助将不胜感激。

参考方案

git push heroku master flask项目时,我遇到了与您相同的问题。我不确定哪个程序包会导致此问题,但这绝对是由于100多个程序包之一。

因为我使用原始的requirements.txt时成功部署。但是heroku在我运行pip freeze > requirements.txt后几次拒绝推送,其中添加了100多个由anaconda自动安装的软件包。我删除了一些heroku无法找到的软件包,最后,它显示出与您遇到的错误相同的错误。然后,我将requirements.txt重置为原始版本,并且成功了!

我的建议是仅添加您需要并且熟悉的软件包。希望这可以帮到你!

Django:错误:您无权访问该端口 - python

我是整个安装的新手,请保持友善。在dev上,该命令通常可以正常工作,但是自从我尝试使用Django的不同命令以来,某些东西就出错了。python manage.py runserver 0.0.0.0:80 我没有使用此端口的权限了。我可以使用端口8080,但将端口添加到url中通常的主机名末尾时,网站无法正常工作。当我使用端口80时,无论如何我都无需在UR…

Django:DateField“此字段不能为空。” - python

我发布这样的休息请求:{title:some title, recurring:true, day:Wednesday, time:12:30, description:some text} 我没有传递日期,因为该事件重复发生,并且该值应该为空。服务器响应为:{"date": ["This field cannot be bla…

Django TestCase不保存我的模型 - python

我目前正在为Django应用编写一些测试。我的应用程序的signal.py文件中具有以下独立功能:def updateLeaveCounts(): # Setting some variables here todaysPeriods = Period.objects.filter(end__lte=today_end, end__gte=today_sta…

django-simple-history,在admin中显示更改的字段 - python

当我从admin.ModelAdmin继承时,在管理页面的历史记录中,我可以看到哪些字段已更改。但是,现在我需要使用django-simple-history来跟踪所有模型更改。现在,对于管理员,我继承了simple_history.SimpleHistoryAdmin。我可以看到所有模型更改并还原它们,但看不到更改了哪些字段。是否可以在SimpleHist…

将Django博客项目集成到HTML网站中 - python

我有一个经常使用HTML5,CSS3,JQUERY和静态图像的网站。我也有一个用Django编写的Blog,我想将其集成到网站中。我对Django真的很陌生,所以我想知道哪种方法是最好的使用方法。我应该将网站代码集成为Django项目的一部分,还是有其他解决方案?谢谢! 参考方案 您有2种方法将当前站点与Django集成。1)您可以使用API编写Django…