7st*_*tud 2 django python-imaging-library pillow
我正在尝试使用Django教程进行探戈,该教程使用django 1.5.我正在使用virtualenvwrapper.我用pip安装了Pillow.
$ pip freeze
Django==1.5.5
Pillow==2.4.0
South==0.8.4
wsgiref==0.1.2.
(tangowithdjango)~/dev_django_projects/tangowithdjango$ which python
/Users/7stud/.virtualenvs/tangowithdjango/bin/python
(tangowithdjango)~/dev_django_projects/tangowithdjango$ python --version
Python 2.7.6
Run Code Online (Sandbox Code Playgroud)
但是,在第8章中我收到以下错误:
(tangowithdjango)~/dev_django_projects/tangowithdjango$ ./manage.py syncdb
Run Code Online (Sandbox Code Playgroud)
CommandError:一个或多个模型未验证:rango.userprofile:"picture":要使用ImageFields,您需要安装Python Imaging Library ...
我无法安装PIL,这就是我安装Pillow的原因:
(tangowithdjango)~/dev_django_projects/tangowithdjango$ pip install PIL
Downloading/unpacking PIL
Could not find any downloads that satisfy the requirement PIL
Some externally hosted files were ignored (use --allow-external PIL to allow).
Cleaning up...
No distributions at all found for PIL
Storing debug log for failure in /Users/7stud/.pip/pip.log
Run Code Online (Sandbox Code Playgroud)
当我尝试:
$ pip install Pillow-PIL
Run Code Online (Sandbox Code Playgroud)
应该将buggy import语句转换为良好的import语句,我得到错误:
找不到满足Pillow-PIL要求的版本(版本:0.1dev)
最后,如果我尝试在shell中使用PIL:
(tangowithdjango)~/dev_django_projects/tangowithdjango$ ./manage.py shell
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from PIL import Image
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/7stud/.virtualenvs/tangowithdjango/lib/python2.7/site-packages/PIL/Image.py", line 53, in <module>
from PIL import _imaging as core
ImportError: dlopen(/Users/7stud/.virtualenvs/tangowithdjango/lib/python2.7/site-packages/PIL/_imaging.so, 2): Symbol not found: _jpeg_resync_to_restart
Referenced from: /Users/7stud/.virtualenvs/tangowithdjango/lib/python2.7/site-packages/PIL/_imaging.so
Expected in: flat namespace
in /Users/7stud/.virtualenvs/tangowithdjango/lib/python2.7/site-packages/PIL/_imaging.so
>>>
Run Code Online (Sandbox Code Playgroud)
pip install PIL --allow-external PIL --allow-unverified PIL
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3453 次 |
| 最近记录: |