简体   繁体   English

Django 1.7无法导入Pillow或PIL:没有名为Image的模块

[英]Django 1.7 Neither Pillow nor PIL could be imported: No module named Image

I am developing an application using Django 1.7 with Python3.4. 我正在使用Django 1.7和Python3.4开发应用程序。 I have installed Pillow as per the instructions from http://pillow.readthedocs.org . 我已经按照http://pillow.readthedocs.org中的说明安装了Pillow。 But whenever I try to upload an image from admin I get following error: 但是,每当我尝试从管理员上传图像时,都会出现以下错误:

ImproperlyConfigured at /admin/content/slide/add/

Neither Pillow nor PIL could be imported: No module named Image

Request Method:     POST
Request URL:    http://www.soujanyam.com/admin/content/slide/add/
Django Version:     1.7.2
Exception Type:     ImproperlyConfigured
Exception Value:    

Neither Pillow nor PIL could be imported: No module named Image

Exception Location:     /usr/local/lib/python3.4/dist-packages/django/utils/image.py in _detect_image_library, line 108
Python Executable:  /usr/bin/python
Python Version:     2.7.6
Python Path:    

['/home/ubuntu/websites/sloppyjoe',
 '/usr/local/lib/python3.4/dist-packages',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages']

sudo apt-get install libapache2-mod-wsgi-py3 须藤apt-get install libapache2-mod-wsgi-py3

Above command solved my problem 上面的命令解决了我的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM