marcp
marcp

Reputation: 1227

img2pdf.py "no module named Image"

Hello I am running Python 2.7 64 bit on windows 7. I've found a python script online called img2pdf.py which could be very useful to me but I can't run it. I've installed the Pillow library for win64 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/) and Image.py is present in "C:\Python27\Lib\site-packages\PIL"

I've downloaded the script to a directory containing my image, and python is on my path but when I type

python img2pdf.py myimage.j2k

at the command prompt I get an error that states

Traceback (most recent call last):
  File "img2pdf.py" line 18, in <module>
    import Image
ImportError: No module named Image

What have I missed?

Upvotes: 0

Views: 4459

Answers (2)

glubzor
glubzor

Reputation: 1

  1. Install Python for Windows, e.g. "python-3.5.0-amd64.exe" --> C:\Python
  2. Extract the zipped archive for img2pdf to C:\Python\Sources\img2pdf
  3. Go to C:\Python\Scripts
  4. Run pip.exe install ..\Sources\img2pdf
  5. The package is now available from command line as "img2pdf.exe" in C:\Python\Scripts

Upvotes: 0

jorispilot
jorispilot

Reputation: 483

On the Pillow library link, it is written:

Note: use from PIL import Image instead of import Image.

But when I look to the img2pdf.py script that I've found here, it is written import Image. So I guess you have to edit your img2pdf.py as specified above.

Upvotes: 2

Related Questions