如何解决由于twisted-iocpsupport 将Django 应用程序部署到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
我该如何解决这个问题?我尝试从我的requirements.txt 文件中删除Twisted 和twisted_iocpsupport 只是为了看看它是否会推送,但这不起作用。
解决方法
twisted_iocpsupport
是仅适用于 Windows 的特定于平台的模块。您将无法在 Heroku 基于 Linux 的平台上构建或安装它。
删除任何声明 twisted_iocpsupport
是您项目的依赖项,这应该会消失。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。