ocr_api_server icon indicating copy to clipboard operation
ocr_api_server copied to clipboard

module 'PIL.Image' has no attribute 'ANTIALIAS'

Open 759085503 opened this issue 2 years ago • 2 comments

我使用docker部署完毕后使用ocr识别,api报错为{"status": 200, "result": "", "msg": "module 'PIL.Image' has no attribute 'ANTIALIAS'"}

759085503 avatar Sep 21 '23 04:09 759085503

请问是我哪里弄得不对吗

759085503 avatar Sep 21 '23 04:09 759085503

Pillow的10.0.0版本移除了ANTIALIAS,现在你只能使用PIL.Image.LANCZOS或者PIL.Image.Resampling.LANCZOS。 解决方法: 输入命令docker exec -it <container id> /bin/bash进入容器,然后运行pip install Pillow==9.5.0,这样将Pillow版本退回到9.5.0版本,最后输入命令docker restart <container id>重启容器就好了。

yalger avatar Oct 12 '23 01:10 yalger