비교적 개발 초기이며 장고 (Windows 7, 64 비트)에서 ImageField를 통한 이미지 업로드를 허용하도록 응용 프로그램을 설치하려고 시도했습니다. 처음에는 PIL을 설치했지만 JPEG와 PNG 라이브러리가 먼저 필요하다는 것을 알았습니다. 그래서 "pip uninstall pil"을 사용하여 PIL을 제거하고 C : \ zlib-1.2.7 \ zlib.lib 및 C : \ jpeg-8d \ libjpeg.lib에서 라이브러리를 설정합니다. 그 후, 나는 PIL의 setup.py에 가서 다음과 같은 변경 : 내가 가진JPEG 및 PNG 라이브러리 사용 PIL
pip install C:\Imaging-1.1.7\
JPEG 거기 시사 설치의 끝에서 다음을 :를 통해 그때 설치
JPEG_ROOT = "C:/jpeg-8d"
ZLIB_ROOT = "C:/zlib-1.2.7"
을
,536,913 : 및 PNG 지원 : 없음 지원을 제안하지 selftest.py로 테스트 할 때 그러나Installing collected packages: PIL
Running setup.py install for PIL
WARNING: '' not a valid package name; please use only.-separated package nam
es in setup.py
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform win32 2.6.6 (r266:84297, Aug 24 2010, 18:46:32)
[MSC v.1500 32 bit (Intel)]
--------------------------------------------------------------------
*** TKINTER support not available (Tcl/Tk 8.5 libraries needed)
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.
To check the build, run the selftest.py script.
Successfully installed PIL
Cleaning up...
, 나는 다음있어 63,210
C:\Windows\system32>python C:\Imaging-1.1.7\selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from C:\Users\ayan\Desktop\Imaging-1.1.7\PIL
Binary modules loaded from C:\Python26_x86\lib\site-packages\PIL
--------------------------------------------------------------------
*** PIL CORE support not installed
*** TKINTER support not installed
*** JPEG support not installed
*** ZLIB (PNG/ZIP) support not installed
*** FREETYPE2 support not installed
*** LITTLECMS support not installed
--------------------------------------------------------------------
가 나는 또한 IO 오류 다음은 JPEG와 함께 작동하도록 노력하고있어 :
C:\Users\Public\Pictures\Sample Pictures>python
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
>>> import os, sys
>>> import Image
>>> img = Image.open(Desert.jpg)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'Desert' is not defined
>>> img = Image.open("Desert.jpg")
>>> img.save("Desert_test.jpg")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26_x86\lib\site-packages\PIL\Image.py", line 1406, in save
self.load()
File "C:\Python26_x86\lib\site-packages\PIL\ImageFile.py", line 189, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "C:\Python26_x86\lib\site-packages\PIL\Image.py", line 385, in _getdecode
r
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available
이 https://stackoverflow.com/questions/10543581/pil-installation-run-issue에서보고 된 것과 다소 비슷합니다; 그러나이 경우 JPEG가 실제로 작동하지 않는 것으로 보입니다. 비슷한 문제가 PNG에서 발생합니다.
내가 실수 한 부분이 어디인지는 분명하지 않으므로 모든 의견을 크게 환영 할 것입니다. 추가 정보가 필요한 경우 알려주십시오. 최대한 제공하기 위해 노력할 것입니다.
감사합니다.