出现这样的错误: 找到错误图中提示的文件:F:\python-2-7\lib\site-packages\PIL\Image.py 通过查找“tostring”,找到如下所示的代码: 改成如下所示: 然后重新运行代码。