在django的models.py在有如下代码, 执行python manage.py runserver后报错:
class Article(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
url = models.URLField()
portal = models.ImageField()
author = models.ForeignKey(Author)
ERRORS:
blog.Article.portal: (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".
提示要安装Pillow,经查Pillow是python的一个图像处理库,下面进行安装
安装装Pillow
pip install --use-wheel Pillow #安装最新的Pillow
安装完成,再次运行发现问题解决。
注:
卸载Pillow
pip uninstall Pillow
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-11-15 20:34:42