【问题标题】:Issue deploying Django app onto Heroku due to twisted-iocpsupport由于 twisted-iocpsupport,将 Django 应用程序部署到 Heroku 时出现问题
【发布时间】:2021-04-22 17:40:58
【问题描述】:

我正在尝试将我制作的 Django 应用程序部署到 Heroku 上。在终于弄清楚如何将其推送到 git 之后,我尝试做

$ git push heroku master

但随后它无法推送,因为它无法构建“twisted_iocpsupport.iocpsupport”扩展。

我得到的错误信息如下。

remote: creating build

remote: creating build/temp.linux-x86_64-3.9

remote: creating build/temp.linux-x86_64-3.9/twisted_iocpsupport

remote: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Itwisted_iocpsupport -I/app/.heroku/python/include/python3.9 -c twisted_iocpsupport/iocpsupport.c -o build/temp.linux-x86_64-3.9/twisted_iocpsupport/iocpsupport.o

remote: twisted_iocpsupport/iocpsupport.c:633:10: fatal error: io.h: No such file or directory

remote: 633 | #include "io.h"

remote: | ^~~~~~

remote: compilation terminated.

remote: error: command '/usr/bin/gcc' failed with exit code 1

remote: ----------------------------------------

remote: ERROR: Failed building wheel for twisted-iocpsupport

remote: Successfully built foil gunicorn Protego PyDispatcher

remote: Failed to build twisted-iocpsupport

remote: ERROR: Could not build wheels for twisted-iocpsupport which use PEP 517 and cannot be installed directly

我该如何解决这个问题?我尝试从我的 requirements.txt 文件中删除 Twisted 和 twisted_iocpsupport 只是为了看看它是否会推送,但这没有用。

【问题讨论】:

    标签: python heroku twisted


    【解决方案1】:

    twisted_iocpsupport 是仅适用于 Windows 的特定于平台的模块。您将无法在 Heroku 基于 Linux 的平台上构建或安装它。

    删除任何声明 twisted_iocpsupport 是项目的依赖项,这应该消失。

    【讨论】:

      猜你喜欢
      • 2012-07-08
      • 2017-01-26
      • 1970-01-01
      • 2021-07-23
      • 2014-11-25
      • 1970-01-01
      • 1970-01-01
      • 2013-10-23
      • 2021-12-25
      相关资源
      最近更新 更多