微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Heroku无法安装AVpyav

如何解决Heroku无法安装AVpyav

我一直在尝试设置我的Python Web应用程序,该应用程序使用opencv,tensorflow和av模块,但一直失败。我尝试使用Aptfile安装多个Ubuntu库(libsm6,libxrender1等),但安装仍然失败。

安装失败后,heroku服务器决定从源代码构建av模块,该模块也会失败,并且gcc在此处失败:

src/av/codec/codec.c:4003:19: warning: implicit declaration of function ‘av_codec_iterate’; did you mean ‘av_codec_next’? [-Wimplicit-function-declaration]
    __pyx_v_ptr = av_codec_iterate((&__pyx_v_opaque));
                ^~~~~~~~~~~~~~~~
                av_codec_next
src/av/codec/codec.c:4003:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
    __pyx_v_ptr = av_codec_iterate((&__pyx_v_opaque));
                ^
src/av/codec/codec.c: In function ‘__pyx_pymod_exec_codec’:
src/av/codec/codec.c:6117:36: error: ‘AV_CODEC_CAP_HARDWARE’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_DR1’?
__pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_HARDWARE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0,121,__pyx_L1_error)
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    AV_CODEC_CAP_DR1
src/av/codec/codec.c:6117:36: note: each undeclared identifier is reported only once for each function it appears in
src/av/codec/codec.c:6138:36: error: ‘AV_CODEC_CAP_HYBRID’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_DR1’?
__pyx_t_7 = __Pyx_PyInt_From_int(AV_CODEC_CAP_HYBRID); if (unlikely(!__pyx_t_7)) __PYX_ERR(0,125,__pyx_L1_error)
                                    ^~~~~~~~~~~~~~~~~~~
                                    AV_CODEC_CAP_DR1
error: command 'gcc' Failed with exit status 1

有人经历过吗?或在Heroku中使用AV / pyav有任何经验吗?请告诉我我错过的任何事情。谢谢。

解决方法

结果证明,使用requirements.txt比使用Pipfile更好地使用Heroku。更改安装文件后,部署过程正常。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。