Python PIL.ImageTk.PhotoImage seg故障

Python PIL.ImageTk.PhotoImage seg故障,python,tkinter,python-imaging-library,Python,Tkinter,Python Imaging Library,我一直在尝试获取一个名为working的Python库,并设法将问题追溯到调用PIL.ImageTk.PhotoImage。以下是问题所在,提炼为一段代码片段: import Tkinter, PIL, PIL.ImageTk, os root = Tkinter.Tk() filename = os.path.expanduser('~/anaconda/lib/python2.7/site-packages/editobj2/icons/python.png') pil_image = P

我一直在尝试获取一个名为working的Python库,并设法将问题追溯到调用
PIL.ImageTk.PhotoImage
。以下是问题所在,提炼为一段代码片段:

import Tkinter, PIL, PIL.ImageTk, os

root = Tkinter.Tk()
filename = os.path.expanduser('~/anaconda/lib/python2.7/site-packages/editobj2/icons/python.png')
pil_image = PIL.Image.open(filename)
image = PIL.ImageTk.PhotoImage(image=pil_image) # Segmentation fault: 11
image = PIL.ImageTk.PhotoImage(file=filename) # Segmentation fault: 11
我不仅在PNG上遇到了这个问题,在GIF和JPEG上也遇到了这个问题。
PIL.Image.open
调用似乎工作正常。例如,我可以调用
pil_image.thumboil
并获得正确的输出

我在运行macOS Sierra 10.12.5。我的Python版本信息是
Python 2.7.10 | Anaconda 2.3.0(x86_64)|(默认,2015年5月28日,17:04:42)
。运行
pip安装--upgrade PIL
告诉我我有最新版本,我不知道应该检查9000个Tk包中的哪个版本

似乎我有可能遇到与报道中相同的问题。谢谢