小编Iva*_*vic的帖子

枕头不工作

我刚刚开始了一个新的 Django 项目,当我尝试 makemigratons 时,我收到一条错误消息,说我必须安装 Pillow 而我已经安装了 Pillow。

ERRORS:
shop.ProductImages.product_img: (fields.E210) Cannot use ImageField because Pillow is not installed.
HINT: Get pillow at https://pypi.python.org/pypi/Pillow or run command "pip install pillow".
Run Code Online (Sandbox Code Playgroud)

当我运行 pip freeze 时,我可以看到 Pillow 已经安装:

Pillow==2.7.0
Run Code Online (Sandbox Code Playgroud)

我使用的是 Python 3.4.3 和 Django 1.8。我在使用 Python 2.7 时没有这个问题。

更新:

当我尝试从我的 virtualenv 之外的 PIL 导入 Image 时,一切都很好,但是当我在 virtualenv 中尝试时,我得到了这个:

Traceback (most recent call last):
Fille "<stdin>", line 1, in <module>
File "C:\Python27\Lib\site-packages\PIL\Image.py", line 63, in <module>
from PIL import _imaging as core
ImportError: …
Run Code Online (Sandbox Code Playgroud)

django python-3.x pillow

0
推荐指数
1
解决办法
3704
查看次数

标签 统计

django ×1

pillow ×1

python-3.x ×1