I am trying to install a Python image library and received a message saying that I am setting success
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform darwin 2.6.9 (unknown, Sep 9 2014, 15:05:12)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
Run codeHide resultBut when I run the code, I received an error message that probably told me that I did not install the JPEG library
/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /Users/tian/PycharmProjects/helloworld/image_test.py
Traceback (most recent call last):
File "/Users/tian/PycharmProjects/helloworld/image_test.py", line 35, in <module>
image.save('code.jpg', 'jpeg')
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 1439, in save
save_handler(self, fp, filename)
File "/Library/Python/2.7/site-packages/PIL/JpegImagePlugin.py", line 471, in _save
ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
File "/Library/Python/2.7/site-packages/PIL/ImageFile.py", line 495, in _save
e = Image._getencoder(im.mode, e, a, im.encoderconfig)
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 401, in _getencoder
raise IOError("encoder %s not available" % encoder_name)
IOError: encoder jpeg not available
Run codeHide resultWhen I searched for the cause of this error on Google, most of the solution was to reinstall PIL, but when I installed PIL I got the message “JPEG support”, so it should not be caused by the JPEG library. Then, how do I solve this problem?
My OS is OS X Yosemite 10.10
source
share