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

时间:2015-01-09 10:35:05

标签: python linux ubuntu python-3.x

我正在使用Django 1.7和Python3.4开发一个应用程序。我按照http://pillow.readthedocs.org的说明安装了枕头。但每当我尝试从管理员上传图像时,我都会收到以下错误:

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']

1 个答案:

答案 0 :(得分:0)

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

上面的命令解决了我的问题