首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >qt抱怨2组二进制文件

qt抱怨2组二进制文件
EN

Stack Overflow用户
提问于 2020-02-17 23:12:33
回答 1查看 9.9K关注 0票数 7

我正在尝试使用conda建立一个环境。我的environemnt.yml看起来像:

代码语言:javascript
复制
name: name
channels:
  - defaults
  - conda-forge
  - pytorch
  # - fastai
dependencies:
  - python = 3.7.5
  - numpy
  - pillow
  - matplotlib
  - pytorch
  - torchvision
  # - json
  # - zipfile
  # - csv
  - pandas
  # - pickle
  # - glob
  - scikit-learn
  - pip # needed to install pip dependencies below
  - pip:
    # - opencv-contrib-python
    -  opencv-python
  - pyarrow
  # - qt

我一直试图添加和删除qt包。如果我去掉qt,我得到了[qt.qpa.plugin] Could not find the Qt platform plugin "cocoa" in ""

然后我尝试添加qt,希望我能得到cocoa插件。

当我运行应用程序时,我得到

代码语言:javascript
复制
objc[4831]: Class RunLoopModeTracker is implemented in both /opt/miniconda3/envs/grapheme/lib/python3.7/site-packages/cv2/.dylibs/QtCore (0x11e1e87f0) and /opt/miniconda3/envs/grapheme/lib/libQt5Core.5.9.7.dylib (0x1a33234a80). One of the two will be used. Which one is undefined.
loaded library "/opt/miniconda3/envs/grapheme/plugins/platforms/libqcocoa.dylib"
QObject::moveToThread: Current thread (0x7fb18afea390) is not the object's thread (0x7fb18f900090).
Cannot move to target thread (0x7fb18afea390)

You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
QObject::moveToThread: Current thread (0x7fb18afea390) is not the object's thread (0x7fb18f900090).
Cannot move to target thread (0x7fb18afea390)

You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "/opt/miniconda3/envs/grapheme/plugins/platforms/" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: cocoa (from /opt/miniconda3/envs/grapheme/plugins/platforms/), minimal (from /opt/miniconda3/envs/grapheme/plugins/platforms/), offscreen (from /opt/miniconda3/envs/grapheme/plugins/platforms/), cocoa, minimal, offscreen.
EN

回答 1

Stack Overflow用户

发布于 2020-06-29 23:07:55

这解决了我的问题。你可以试试。

pip安装opencv-python-无头

这些包不包含任何GUI功能。它们体积较小,适合于更受限制的环境。如果您只需要主要模块,请运行pip安装opencv-python

票数 18
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60271645

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档