Mongoengine.fields.ImproperlyConfigured: PIL library not found

When I try to import the MongoEngine class with ImageField, the error says:

mongoengine.fields.ImproperlyConfigured: PIL library was not found

My class structure is as follows:

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

What is the problem?

+4
source share
1 answer

You need to install Pillowwhich module provides PIL. sudo pip install Pillow(discard sudoif on Windows) this should do.

+4
source

All Articles