You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Docker中Odoo导入含WebP图片URL的Excel触发PIL.UnidentifiedImageError

Odoo Docker容器导入WebP图片URL报错问题

尝试将包含图片URL的XLSX文件导入Docker容器内的Odoo系统时,部分WebP格式的图片URL触发如下错误:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/var/lib/odoo/.local/lib/python3.10/site-packages/PIL/Image.py", line 3572, in open
    raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x75889b2817b0>

使用以下代码进行测试:

  • 在Odoo Docker容器的Python解释器(未启动Odoo)中运行,无报错
  • 在Odoo运行时的调试控制台中执行,触发上述错误

测试代码:

import io
from PIL import Image
import requests
res = requests.get('https://www.gstatic.com/webp/gallery/1.webp')
content = bytearray()
for chunk in res.iter_content(32768): content += chunk
image = Image.open(io.BytesIO(content))

内容的提问来源于stack exchange,提问作者Arlème Johnson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 00:04:57