unbit / unbit-docs

Documentazione per deployment su piattaforma Unbit
2 stars 1 forks source link

python: Pillow al posto di PIL #2

Closed xrmx closed 11 years ago

xrmx commented 11 years ago

Nelle prossime installazione di python (es python275) sui server sarebbe comodo avere Pillow al posto di PIL. Il problema è che non sono installabili contemporaneamente e che per risparmiare tempo / spazio quando creo i virtualenv riciclo i pacchetti già presenti nel sistema usando il flag --system-site-packages.

unbit commented 11 years ago

disponibile da domattina

xrmx commented 11 years ago

Sembra che sia stato installato contemporanemante pure PIL (vedi /opt/unbit/python275/lib/python2.7/site-packages/PIL/PIL-1.1.7-py2.7.egg-info) e per esempio il formato Webp non funziona

$ /opt/unbit/python275/bin/python Python 2.7.5 (default, Jun 6 2013, 15:36:31) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information

from PIL import Image im = Image.open("cartina_italia.png").convert("RGB") im.save("foo.webp", "WEBP") Traceback (most recent call last): File "", line 1, in File "/opt/unbit/python275/lib/python2.7/site-packages/PIL/Image.py", line 1458, in save save_handler = SAVE[format.upper()] # unknown format KeyError: 'WEBP'

xrmx commented 11 years ago

Ora è proprio spaccato del tutto:

$ /opt/unbit/python275/bin/python Python 2.7.5 (default, Jun 6 2013, 15:36:31) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

from PIL import Image Traceback (most recent call last): File "", line 1, in ImportError: No module named PIL

xrmx commented 11 years ago

Webp non funziona ma il resto pare ok, grazie.