用BytesIO替代StringIO即可解决问题 from io import BytesIO out = BytesIO() image.save(out, format='JPEG')
TypeError: string argument expected, got ‘bytes‘,第十二行用BytesIO()代替StringIO()