0

I am using a Jupyter Notebook within AWS SageMaker for a project that I am working on, (Jupyter Notebook is running conda-python3) and I need to convert several files that I have in the formats: PPTX, PPT and PDF, into an Image format (JPG, JPEG, PNG). I believe the major issue I am having is that I cannot download libraries into a Jupyter instance as it doesn't have a conventional download path I can draw from.

I have tried using Wand and Imagemagick, but I always run into problems. I have also used some 3rd party packages like pdf2jpg but none of them work (I believe it is because I do not know how to download the Poppler library in Jupyter).

I believe that the below issue is do to with a fact that I have a 32 bit Python running when Imagemagick is running as 64 bit, but I do not know how to check what bit size I am running on Python or how to download 32 bit Imagemagick on Jupyter

ImportError: MagickWand shared library not found.
You probably had not installed ImageMagick library.

this happens when i call

from wand.image import Image

Could you please advise me?

Kate Orlova
  • 3,225
  • 5
  • 11
  • 35
  • You may be correct with regard to bit depth of the software. Is it possible that ImageMagick is not installed? Another possibility, if you get that fixed and it still fails, is that you either do not have Ghostscript installed for ImageMagick to use for reading PDF or your ImageMagick policy.xml file is restricting use of PDF. See https://stackoverflow.com/questions/52861946/imagemagick-not-authorized-to-convert-pdf-to-an-image/52863413#52863413 – fmw42 Jul 06 '19 at 00:26

1 Answers1

0

Can you try pip install both Wand and magickwand, also install the Wand library using sudo yum install ImageMagick-devel I was able to import wand.image after installing those libraries.

Ref: http://docs.wand-py.org/en/latest/guide/install.html

Thanks for using Amazon SageMaker!

Han
  • 222
  • 1
  • 2