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)