【问题标题】:Install poppler onto Heroku Server django在 Heroku Server django 上安装 poppler
【发布时间】:2019-02-18 00:40:15
【问题描述】:

我正在尝试在我的 Heroku 服务器上安装 poppler,因为我使用 pdf2image 作为 python 包。但是,我不能像在 Mac 上那样只运行 brew install poppler

我试图从互联网上添加一些heroku buildpacks,但没有运气。每当 pdf2image 运行时,我都会收到此错误。

pdf2image.exceptions.PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?

我可以在命令行上做些什么来安装 poppler,同时保持 heroku/python 作为我的 buildpack?

【问题讨论】:

    标签: django heroku poppler


    【解决方案1】:

    您可以在 Heroku 上安装带有 experimental function 的 APT 包

    步骤:

    1. 将 buildpack 添加到 Heroku。

      heroku buildpacks:add --index 1 heroku-community/apt
      
    2. 在你的项目文件夹中创建一个名为Aptfile的文件,并在里面写入poppler-utils

    3. 提交并推送。

    【讨论】:

      【解决方案2】:

      我可以在命令行上做些什么来安装 poppler,同时将 heroku/python 作为我的 buildpack 吗?

      Heroku lets you run multiple buildpacks。我没有尝试过这个 buildpack,但我建议将 this buildpack 添加到您现有的应用程序中:

      heroku buildpacks:set heroku/python
      heroku buildpacks:add --index 1 https://github.com/survantjames/heroku-buildpack-poppler.git
      

      然后重新部署您的应用程序。

      【讨论】:

        【解决方案3】:

        !pip install python-poppler:它给我这个错误。 试试:https://elements.heroku.com/buildpacks/k16shikano/heroku-buildpack-poppler 这对我有用。

        【讨论】:

          猜你喜欢
          • 2011-08-31
          • 2013-08-25
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-10-28
          • 1970-01-01
          • 1970-01-01
          • 2020-04-17
          相关资源
          最近更新 更多