0

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?

4

2 回答 2

2

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.

于 2013-08-29T17:22:18.423 回答
0
  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
于 2015-11-25T01:45:19.360 回答