本文介绍了mongoengine.fields.ImproperlyConfigured:找不到PIL库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试导入具有ImageField的MongoEngine类时,出现错误消息:
When I try to import a MongoEngine class which has an ImageField, an error says:
mongoengine.fields.ImproperlyConfigured: PIL library was not found
我的班级结构是这样的:
My class structure is like this:
class TrafficSign(Document):
name = StringField()
image = ImageField()
type = StringField()
desc = StringField()
source = StringField()
出什么问题了?
推荐答案
您需要安装 Pillow
,它提供了PIL
模块. sudo pip install Pillow
(如果在Windows上,请删除sudo
)应该做到这一点.
You need to install Pillow
, which provides the PIL
module. sudo pip install Pillow
(drop the sudo
if on Windows) ought to do it.
这篇关于mongoengine.fields.ImproperlyConfigured:找不到PIL库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!