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

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

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

  2. 列表内容
    目录下的文件如下:
    pyinstaller打包python程序时VideoCapture()不响应问题的处理_第1张图片

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

你可能感兴趣的:(python3.6,opencv3.3,python,visual,studio)