4

I am trying to install poppler on my Heroku server because I am using pdf2image as a python package. However, I can't just run brew install poppler like I did on my Mac.

I have tried to add some heroku buildpacks off the internet but with no luck. Anytime pdf2image runs I get this error.

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

Is there something I can do on the command line to get poppler installed while keeping heroku/python as my buildpack?

Adam LaMorre
  • 655
  • 7
  • 21

2 Answers2

5

You can install APT packages with an experimental function on Heroku

Steps:

  1. Add the buildpack to Heroku.

    heroku buildpacks:add --index 1 heroku-community/apt
    
  2. Make a file named Aptfile in your project folder and write poppler-utils inside.

  3. Commit and push.
DE0CH
  • 113
  • 2
  • 4
4

Is there something I can do on the command line to get poppler installed while keeping heroku/python as my buildpack?

Heroku lets you run multiple buildpacks. I haven't tried this buildpack, but I'd recommend adding this buildpack to your existing app:

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

Then redeploy your application.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257