如何在 opencv - cv2(Pycharm 和 macOS)中解决 "process finished with exit code 139 (interrupted by signal 11: SIGSEGV)"?

How can I solve "process finished with exit code 139 (interrupted by signal 11: SIGSEGV)" in opencv - cv2 ( Pycharm & macOS)?

我正在学习 OpenCV,但我遇到了一些困难,cv2 导入没问题,但是 cv2.imshow

出现错误
from cv2 import cv2

img = cv2.imread('image.jpg', 0)

cv2.imshow('1', img)

cv2.waitKey(100)

cv2.destroyAllWindows()

它会得到结果:

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

我的跟踪树太长所以我把它放在下面的 link 中: https://justpaste.it/1tf4q

我遇到了同样的问题并找到了 link 问题:https://github.com/opencv/opencv/issues/18079

现在我将 OpenCV 从 4.4.40 降级到 4.3.0.36,它对我有用。