如何在Heroku上安装7 zip

时间:2019-03-11 06:43:10

标签: python heroku

我使用python脚本在Windows上使用7zip制作zip文件

但不是在Heroku中。.在Heroku中,我必须安装7zip app。如何使用sudo

我在heroku bash上使用apt-get install 7zip-full。但是下面是我的返回错误: $ apt-get install p7zip-full apt-get install p7zip-full Reading package lists... Done Building dependency tree Reading state information... Done W: Not using locking for read only lock file /var/lib/dpkg/lock-frontend W: Not using locking for read only lock file /var/lib/dpkg/lock E: Unable to locate package p7zip-full

现在我的问题是:

如何在heroku上安装7zip?

1 个答案:

答案 0 :(得分:0)

如果要在Heroku上使用7zip
这是7zip的构建包

https://github.com/opendoor-labs/heroku-buildpack-p7zip

使用此官方Heroku指南https://devcenter.heroku.com/articles/buildpacks了解如何添加buildpack或仅使用以下命令

heroku buildpacks:set -a <应用程序名称>

Buildpack:URL只是您或其他任何人的buildpack的github URL,也可以是官方的build pack名称

应用名称是指您为应用指定的名称

如果您不想使用命令行,也可以使用以下命令

转到仪表板->选择您的应用程序->向下滚动,直到看到带有添加buildpack按钮的buildpack部分,输入给定的7zip buildpack GitHub链接并完成

还有适用于python3 py7zr的替代7zip