mongoengine.fields.ImproperlyConfigured: PIL library was not found

倖福魔咒の 提交于 2019-12-12 12:23:11

问题


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()

Whats the problem?


回答1:


You need to install Pillow, which provides the PIL module. sudo pip install Pillow (drop the sudo if on Windows) ought to do it.



来源:https://stackoverflow.com/questions/25811805/mongoengine-fields-improperlyconfigured-pil-library-was-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!