这个错误有点棘手,因为我使用的代码在我的其他系统上运行没有问题。我今天在一台新机器上安装了这些库,并在尝试运行我的代码时遇到了错误(适用于其他 OSX 10.9 机器)。
Traceback (most recent call last):
File "proofer.py", line 295, in <module>
main()
File "proofer.py", line 286, in main
save_target = composite1(proof1)
File "proofer.py", line 170, in composite1
blank_canvas.paste(proof.sized, (paste_width, paste_height))
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 1103, in paste
self.im.paste(im, box)
SystemError: new style getargs format but argument is not a tuple
它引用的代码如下
blank_canvas.paste(proof.sized, (paste_width, paste_height))
proof.sized 是一个 PIL.Image 对象,如下所示:
proof.sized=proof.image.resize(tuple([int(des_xx), int(des_yy)]), Image.BICUBIC)
在这种情况下,我的错误消息似乎不正确,因为问题不在于 im.paste() 的第二个参数的元组性。从我所做的研究来看,似乎很多人都收到了这种反馈,不管他们的实际问题是什么。
那么......我在这里错过了什么?此代码在我的其他系统上运行良好。我怎么能弄清楚这个?