gpt4 book ai didi

python - Django 1.7 Pillow 和 PIL 都无法导入 : No module named Image

转载 作者:太空宇宙 更新时间:2023-11-04 03:46:56 25 4
gpt4 key购买 nike

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

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

以上命令解决了我的问题

关于python - Django 1.7 Pillow 和 PIL 都无法导入 : No module named Image,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27858657/

25 4 0