Python的PIL图像库不工作

2024-10-01 07:48:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个奇怪的错误,当试图使用枕头保存在我的Django管理图像。。。在

from PIL import _imaging as core
ImportError: cannot import name _imaging

文件模型.py:

^{pr2}$

文件管理员py

class GenericImageAdmin(admin.ModelAdmin):
    list_display    = ["__unicode__", "title", "created", "thumbnail"]

    def save_model(self, request, obj, form, change):
        obj.user = request.user
        obj.save()

admin.site.register(GenericImage, GenericImageAdmin)

最奇怪的是,当我删除时也会出现同样的错误

from PIL.Image import core as _imaging

我用的是Pillow,不是旧的PIL。怎么回事?在


Tags: 文件frompycoreimportobjpiladmin