问题
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