Python TypeError: 'bytes' object cannot be interpreted as an integer. How to add 'bytes'?

Python TypeError: 'bytes' object cannot be interpreted as an integer. How to add 'bytes'?

我在使用保存时遇到错误TypeError: 'bytes' object cannot be interpreted as an integer,如何才能正确保存?

我想保存在同一个图像中,而不是创建一个新图像。

from iptcinfo3 import IPTCInfo
import sys
imagename = 'horse.jpg'
info = IPTCInfo(imagename)
info['keywords'] = 'horse', 'brown', 'animal', 'nature'
info.save()

如何添加'bytes'? Documentation什么都没说?

我以前没有使用过这个特定的包,但我相信关键字应该是一个 python 列表(我可能错了)

您是否试过像这样在关键字周围添加方括号?

from iptcinfo3 import IPTCInfo
import sys
imagename = 'horse.jpg'
info = IPTCInfo(imagename)
info['keywords'] = ['horse', 'brown', 'animal', 'nature']
info.save()