Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install poppler onto Heroku Server django

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?

like image 434
Adam LaMorre Avatar asked Sep 11 '25 16:09

Adam LaMorre


2 Answers

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.
like image 198
DE0CH Avatar answered Sep 13 '25 06:09

DE0CH


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.

like image 43
Chris Avatar answered Sep 13 '25 06:09

Chris