DEV Community

Mintu Agarwal
Mintu Agarwal

Posted on

Installation Guide for pdf2image for python

Recently for my Python project, I wanted to create images of the generated PDF from my script. I added an option to whether I want to create the images and used pdf2image.convert_from_path to create jpeg files for the same.

However, the installation of pdf2image isn't your usual pip3 install pdf2image. It would rather throw an error like this -

The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.
Enter fullscreen mode Exit fullscreen mode

So first install some dependencies into your system using and then execute you pip3 install command

sudo apt-get install libjpeg-dev zlib1g-dev
pip3 install pdf2image
Enter fullscreen mode Exit fullscreen mode

Also

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay