pyinstaller打包python+opencv 无法在别人电脑上正常运行 问题所在:opencv_ffmpeg341_64.dll
用python+opencv写了个程序,在自己电脑上一切正常,但在别人电脑上就是运行不了 报错: Exception in Tkinter callback Traceback (most recent call last): File "tkinter\__init__.py", line 1699, in __call__ File "ShowTheWay.py", line 53, in main NameError: name 'img' is not defined Traceback (most recent call last): File "ShowTheWay.py", line 25, in on_mouse NameError: name 'img' is not defined 然后我又回去查代码,也没有写错啊,后来加了几个检查点,才发现是视频读取这里就已经出了问题 def re_size(): global img img = None re_set() if shipin.isOpened(): ret, frame = shipin.read() h, w, _ = frame.shape img = cv2.resize(frame, (int(w / s), int(h / s)), interpolation= cv2.INTER_AREA)