编程语言
首页 > 编程语言> > python – mongoengine.fields.ImproperlyConfigured:找不到PIL库

python – mongoengine.fields.ImproperlyConfigured:找不到PIL库

作者:互联网

当我尝试导入具有ImageField的MongoEngine类时,错误说:

mongoengine.fields.ImproperlyConfigured: PIL library was not found

我的类结构是这样的:

class TrafficSign(Document):
    name = StringField()
    image = ImageField()
    type = StringField()
    desc = StringField()
    source = StringField()

有什么问题?

解决方法:

您需要安装Pillow,它提供PIL模块. sudo pip install Pillow(如果在Windows上放弃sudo)应该这样做.

标签:python,mongodb,mongoengine
来源: https://codeday.me/bug/20190624/1277350.html