首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Django枕头/PIL误差

Django枕头/PIL误差
EN

Stack Overflow用户
提问于 2014-05-02 22:35:28
回答 1查看 3.6K关注 0票数 2

我试着用Django教程做Tango,它使用django 1.5。我在用虚拟包装器。我给枕头装了pip。

代码语言:javascript
复制
$ 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

但是,在第8章中,我得到了以下错误:

代码语言:javascript
复制
(tangowithdjango)~/dev_django_projects/tangowithdjango$ ./manage.py syncdb 

CommandError:一个或多个模型没有验证: rango.userprofile:“图片”:要使用ImageFields,需要安装Python .

我无法安装PIL,所以我安装了枕头:

代码语言:javascript
复制
(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

当我尝试:

代码语言:javascript
复制
$ pip install Pillow-PIL 

它应该将buggy导入语句转换为良好的导入语句,我得到了以下错误:

找不到满足Pillow-PIL要求的版本(来自版本: 0.1dev)

最后,如果我试图在shell中使用PIL:

代码语言:javascript
复制
(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
>>> 
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-05-03 00:43:09

source

代码语言:javascript
复制
pip install PIL --allow-external PIL --allow-unverified PIL
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23437947

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档