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



我正在开发一个使用 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']

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

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

最新更新