欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

处理pyinstaller打包python程序时VideoCapture()不响应问题

程序员文章站 2022-04-15 12:49:04
软件环境 win10 32位 VisualStudio2017-15.5.3 python3.6.3 pyinstaller3.3 opencv3.3.1 问题 我以...

软件环境
win10 32位
VisualStudio2017-15.5.3
python3.6.3
pyinstaller3.3
opencv3.3.1
问题
我以前的win7系统,用pyinstaller打包ptython程序(opencv程序)都没有问题。
但在win10系统中,用pyinstaller打包后,在cv2.VideoCapture()处出现闪退。
但是在VS2017或者IDLE中程序运行都非常正常。
解决办法

打开opencv目录 我的目录如下: C:\Program Files\Microsoft Visual
Studio\Shared\Python36_86\Lib\site-packages\cv2

列表内容
目录下的文件如下:
处理pyinstaller打包python程序时VideoCapture()不响应问题

将其中的opencv_ffmpeg330.dll拷贝到打包后的dist目录下。 重新运行exe文件,正常。