Error while trying to use pdf2image on heroku : libpng12.so.0: cannot open shared object file: No such file or directory
Question:
I get the Exception:
pdfinfo: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
on the line
images = pdf2image.convert_from_path("filename.pdf")
I tried adding this buildpack, but it didn’t solve the problem.
Answers:
had the same issue and solved it as follows:
- Remove the libpng buildback and the poppler utils buildback
- Create an
Aptfile
in the root directory of your project and add libpng-dev
and poppler-utils
to the file
- Add the official heroku api buildback
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
- Push a new version of your app to Heroku.
I get the Exception:
pdfinfo: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
on the line
images = pdf2image.convert_from_path("filename.pdf")
I tried adding this buildpack, but it didn’t solve the problem.
had the same issue and solved it as follows:
- Remove the libpng buildback and the poppler utils buildback
- Create an
Aptfile
in the root directory of your project and addlibpng-dev
andpoppler-utils
to the file - Add the official heroku api buildback
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
- Push a new version of your app to Heroku.