我在Heroku上运行了一个python flask应用程序,它使用soundfile library。在将soundfile添加到requirements.txt之后,Heroku给了我这个错误:
raise OSError('sndfile library not found')我looked it up并读到我需要导入libsndfile1库。但当我也将其添加到requirements.txt中时,构建失败并显示错误:
找不到libsndfile1的匹配分发
有没有办法导入这个包,这样我就可以在Heroku上使用soundfile?
发布于 2019-09-01 20:55:31
libsndfile1不是Python库,所以您不能通过requirements.txt安装它。
其中一种方法是将apt buildpack与Python buildpack一起使用:
要使用两个requirements.txt
libsndfile1:heroku buildpack:set heroku/python heroku buildpack:Add --index 1 heroku-community/apt heroku buildpacks #应该首先显示apt,然后python
Aptfile:libsndfile1
apt部署。发布于 2019-10-27 13:02:30
创建一个'Aptfile‘并添加以下行:
libasound2-dev python-dev python-numpy python-setuptools libsndfile-dev
这对我很有效。
https://stackoverflow.com/questions/57743005
复制相似问题