由于twisted-iocpsupport,将 Django 应用程序部署到 Heroku 时出现问题

అక్*_*పాద 3 python twisted heroku

我正在尝试将我制作的 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

Run Code Online (Sandbox Code Playgroud)

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

Jea*_*one 7

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

删除您拥有的项目依赖项的任何声明twisted_iocpsupport,这应该会消失。