热门

最新

红包

立Flag

投票

同城

我的

发布
a1119330575
a1119330575
3 年前
truea1119330575

 问题描述,程序中含有cv2库,使用pyinstaller打包成exe后,执行出现闪退,并且报错没导入cv2库,百度得知是cv2版本太高

报错代码: 

raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.
[15648] Failed to execute script '调用摄像头' due to unhandled exception!


 

raise ImportError('ERROR: recursion is detected during loading of "cv2" bina

执行下列操作,重新安装低版本cv2后,问题解决

pip uninstall opencv-python
pip install opencv-python==4.5.1.48


 Python程序打包成exe

pip install pyinstaller #安装打包程序
pyinstaller -F 要打包的python程序


 重新打包后程序正常执行

pyinstaller打包含有cv2库的python程序为exe,运行后显示没导入成功

CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
https://blog.csdn.net/u010386121/article/details/119382696
立即登录