Django 1.4.1 で PIL を使用して画像をアップロードしてサイズ変更しようとしています。
私はこれを試しました: https://stackoverflow.com/a/10109941/356875
しかし、何も変わりませんでした。
私が使用するvirtualenv
と、次のpip install -I PIL
エラーが発生します。
running install_lib
creating /usr/lib/python2.7/site-packages
error: could not create '/usr/lib/python2.7/site-packages': Permission denied
だから私はsudo pip install -I PIL
これがうまくいくと私にこれを与える必要があります:
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2]
--------------------------------------------------------------------
*** TKINTER support not available
--- 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.
changing mode of build/scripts-2.7/pildriver.py from 644 to 755
changing mode of build/scripts-2.7/pilprint.py from 644 to 755
changing mode of build/scripts-2.7/pilfile.py from 644 to 755
changing mode of build/scripts-2.7/pilconvert.py from 644 to 755
changing mode of build/scripts-2.7/pilfont.py from 644 to 755
changing mode of /usr/local/bin/pildriver.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
changing mode of /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pilconvert.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
Successfully installed PIL
Cleaning up...
ただし、モデルを保存しようとすると、次のエラーが発生します。
IOError at /admin/main/pagecategory/21/
decoder jpeg not available
Request Method: POST
Request URL: http://localhost:8000/admin/main/pagecategory/21/
Django Version: 1.4.1
Exception Type: IOError
Exception Value:
decoder jpeg not available
Exception Location: /home/chris/.virtualenvs/holistic/lib/python2.7/site-packages/PIL/Image.py in _getdecoder, line 385
Python Executable: /home/chris/.virtualenvs/holistic/bin/python
Python Version: 2.7.3
Python Path:
['/home/chris/Dropbox/workspace/holistic',
'/home/chris/.virtualenvs/holistic/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/home/chris/.virtualenvs/holistic/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg',
'/home/chris/.virtualenvs/holistic/lib/python2.7',
'/home/chris/.virtualenvs/holistic/lib/python2.7/plat-linux2',
'/home/chris/.virtualenvs/holistic/lib/python2.7/lib-tk',
'/home/chris/.virtualenvs/holistic/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/home/chris/.virtualenvs/holistic/lib/python2.7/site-packages',
'/home/chris/.virtualenvs/holistic/lib/python2.7/site-packages/PIL',
'/usr/local/lib/python2.7/site-packages',
'/usr/local/lib/python2.7/dist-packages',
'/usr/local/lib/python2.7/dist-packages/PIL']
Server time: Fri, 4 Jan 2013 12:35:58 +0200
私は何を間違っていますか?
(PS:リモートホスティングLinuxサーバーでもまったく同じ構成で問題なく動作します)
編集:別の詳細な出力を貼り付けましたありがとう。http://dpaste.com/867770/