MatplotLib (TKinter) + OpenCV crashing in Python 3 -
i trying run python 3 code first shows opencv window , when closes should plot using matplotlib. upon plt.show() call program crashes: python3.6 quit unexpectedly. import numpy np import matplotlib matplotlib.use("tkagg") # <== doesn't solve problem import matplotlib.pyplot plt import cv2 #cv2.ocl.setuseopencl(false) <== doesn't solve problem im = np.zeros((100,100,3)) cv2.imshow('test', im) cv2.waitkey(0) plt.plot(np.sin(np.linspace(0,20,200))) plt.show() # <== crashes on call in other stackoverflow posts found setting matplotlib backend tkagg should fix or setting setuseopencl(false) . both these potential fixes not work on macbook. i've tried several things, changing import order, trying swap matplotlib backend. has idea on how fix problem? macos sierra 10.12.3 python 3.6.0 tkinter version 8.5 opencv version 3.2.0 matplotlib version 2.0.0 the stacktrace of how crashes: libc++abi.dylib: terminat