PIL 오류 정보 — IOError : 디코더 zip을 사용할 수 없습니다.
나는 얻는다 :
IOError: decoder zip not available
이미지를 그리고 PIL에서 jpeg로 저장하려고 할 때. 이 문제를 해결하는 방법에 대한 의견이 있으십니까? PIL은 과거에 이미지보기 / 업로드와 관련하여 잘 작동했습니다.
jpeg를 저장하려면 zip 디코더 만 필요합니다. jpeg를 미리 보려면 OS X에서이 단계를 따라야한다고 생각합니다.
다음을 수행해야 함을 의미합니다.
- PIL 소스를 다운로드 합니다 .
- zlib 라이브러리를 다운로드하십시오.
- PIL 소스를 zlib 라이브러리를 가리 킵니다.
- PIL을 빌드하십시오.
sudo pip uninstall PIL
sudo pip install pillow
^^ 나를 위해 수정했습니다.
Pillow 는 pip / setuptools와 호환되는 PIL의 포크이며 유지 관리가 약간 향상됩니다.
아직 API 차이를 보지 못했습니다.
편집 : 주목할만한 API 차이점이 하나 있습니다. PIL은 Image를 최상위 네임 스페이스로 노출하므로
import Image # in PIL only
그러나
from PIL import Image # in pillow or PIL
- 고마워, Leopd!
Ubuntu 64 비트에서 zlib 라이브러리를 사용한 자세한 설치 PIL :
http://obroll.com/install-python-pil-python-image-library-on-ubuntu-11-10-oneiric/
게으른 사용자의 경우 (@ meawoppl에 대한 크레딧 apt-get
) :
$ sudo apt-get install libjpeg-dev zlib1g-dev
64 비트 우분투 13.04 데스크톱 버전 에서이 문제가 발생했으며 해결 방법은 다음과 같습니다.
PIL을 다시 설치하고 다시 설치 한 후 출력 정보에주의하십시오.
---------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.4 (default, Sep 26 2013, 03:20:26)
[GCC 4.7.3]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
*** ZLIB (PNG/ZIP) support not available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
줄이 있습니다 : *** ZLIB (PNG/ZIP) support not available
, 이는 PIL이 ZLIB 지원없이 빌드되었음을 의미하며 다음과 같이 수정했습니다.
먼저 다음 패키지를 설치해야합니다. libjpeg-dev libfreetype6-dev zlib1g-dev
sudo apt-get install python-dev libjpeg-dev libfreetype6-dev zlib1g-dev
# create these links, if already exists, remove it and re-link it
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
# reinstall PIL
pip uninstall PIL
pip install PIL
이번에 --- ZLIB (PNG/ZIP) support available
는 출력에 한 줄이 있어야합니다 .
참조 : http://jj.isgeek.net/2011/09/install-pil-with-jpeg-support-on-ubuntu-oneiric-64bits/
나는 같은 문제가 발생했습니다. 베개와 베개 ( 'p'의 다른 케이스)는 두 가지 다른 패키지 인 것 같습니다. 따라서 Pillow를 사용하는 경우 pip install pillow
도움이되지 않을 수 있습니다. 내 해결책은 다음과 같습니다.
$ pip uninstall pillow
$ pip uninstall Pillow
$ sudo apt-get install libjpeg-dev zlib1g-dev
$ pip install -I Pillow
처음 두 줄은 베개 또는 베개 패키지를 제거하는 것입니다.
세 번째 줄은 두 개의 필수 패키지를 설치하는 것입니다.
네 번째는 Pillow를 다시 설치하는 것입니다.
virtualenv를 사용하는 경우 virtualenv에서 pip install/uninstall
실행해야합니다.
OS X Mavericks에서이 문제를 해결 한 방법은 다음과 같습니다.
Brew 설치 :
pip 설치 :
http://www.pip-installer.org/en/latest/installing.html
이를 제자리에두면 다음을 수행 할 수 있습니다.
sudo brew install lzlib # installs zlib
pip uninstall PIL
pip install --no-index -f http://dist.plone.org/thirdparty/ -U PIL
그 후 잘 작동했습니다. 세 번째 줄에 대한 설명은 다음 답변을 확인하십시오.
https://stackoverflow.com/a/2486396/290072
on mac
sudo brew install lzlib # installs zlib
pip uninstall PIL
pip install PIL
I use 64bit ubuntu 14.04LTS desktop version, and I tried Johnny Zhao's answer.
When
exec sudo easy_install PIL
I got an error:
can't find freetype/fterrors.h
and I find freetype2 in /usr/include/
You could solve it by:
sudo ln -s /usr/include/freetype2 /usr/include/freetype
then install will be success
The cause may be you've installed Pillow without zlib support.
On CentOS 7:
yum install zlib zlib-devel
pip install Pillow --upgrade
And if you are using for a webapp restart your webserver to apply.
on my case, i just remore python-image, make sure that libz is ready then reinstall PIL, more detail you can see on my post here :
http://febru.soluvas.com/2014/03/solved-openerp-7-ioerror-decoder-zip.html
Mac OS X PIL JEPG and PNG issues (same for linux os), this Post help me out of both PNG and JPEG issues with PIL : decoder zip not available and decoder jpeg not available
Make sure JPEG and ZLIB are available, when you install / reinstall PIL :
$ cd Imaging-1.1.7
$ python setup.py build_ext -i
$ python selftest.py
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
I tried the version 2.8.0 it works fine me
pip install -Iv Pillow==2.8.0
On Ubuntu 18
I have had to install pillow 2.8.1
:
pip install Pillow==2.8.1
Try: $ sudo apt-get install python-dev $ sudo apt-get install libjpeg8-dev $ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
Starting from version 3.0.0 Pillow needs libjpeg. If the issue persists, there might be some package incompatibility. Save some time and try the previous version: $ pip install Pillow==2.8.1
참고URL : https://stackoverflow.com/questions/3544155/about-the-pil-error-ioerror-decoder-zip-not-available
'Development Tip' 카테고리의 다른 글
Elastic Beanstalk에서 https를 강제하는 방법은 무엇입니까? (0) | 2020.11.09 |
---|---|
NA 만 포함하는 열을 삭제하는 방법은 무엇입니까? (0) | 2020.11.09 |
32/64 비트 또는 CPU 용 C # 컴파일? (0) | 2020.11.09 |
Scala에서 한 번에 여러 예외 잡기 (0) | 2020.11.09 |
OS X 또는 iOS (Gestalt를 사용하지 않고)에서 런타임시 OS 버전을 어떻게 확인합니까? (0) | 2020.11.09 |