【问题标题】:How to fix the pyinstaller xcb plugin issue when using opencv on linux在 Linux 上使用 opencv 时如何解决 pyinstaller xcb 插件问题
【发布时间】:2022-01-15 08:53:04
【问题描述】:

我正在编写一个 python (3.9) 应用程序并希望使用 pyinstaller 分发可执行文件。我正在使用opencv-contrib-python==4.5.4.60opencv-python==4.5.4.60numpy==1.21.4pipenv 环境中运行pyinstaller -w -F ...

生成的可执行文件不断给我这个错误:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/tmp/_MEIuynHyq/cv2/qt/plugins"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Aborted (core dumped)

许多帖子建议更改降级库。我尝试了这个和许多其他的东西都没有成功。提示,建议将不胜感激。

干杯

【问题讨论】:

    标签: python qt opencv pyinstaller


    【解决方案1】:
    1. 这个问题可以通过以下方式解决:

    This might be solvable 通过更改导入、对象实例化或两者的顺序。更改插件加载路径可能是可能的,尽管 python 模块有时会硬编码他们自己的东西应该来自哪里的想法。删除插件的 cv2 版本可能会起作用。如果这些选项不可行或不合理,您可能会在重建 PyQt 和/或 OpenCV 时遇到困难。

    1. 但是我不擅长插件cv2和qt 为此,就我而言,问题已由downgrading cv2 解决

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-24
      • 2013-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多