不为成仙,只为在这红尘中等你回来。

您现在的位置是:网站首页>>Django

天天生鲜 (fields.E210) Cannot use ImageField because Pillow is not installed.

2019年8月8日 23:37 | 分类:Django | 标签: Python Django

问题描述

Python3.5 + Django2.2 天天生鲜项目在迁移数据库($ python3 manage.py makemigrations)时出现如下报错:

(venv) fang@ubuntu:~/dailyfresh$ python manage.py makemigrations
SystemCheckError: System check identified some issues:

ERRORS:
goods.GoodsImage.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
goods.GoodsSKU.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
goods.GoodsType.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
goods.IndexGoodsBanner.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".
goods.IndexPromotionBanner.image: (fields.E210) Cannot use ImageField because Pillow is not installed.
    HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "pip install Pillow".

出错原因

ImageField 字段需要用到 Pillow 库。

解决方法

$ pip install Pillow