Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt xcb error? #108

Closed
GalSang17 opened this issue Jun 20, 2023 · 6 comments
Closed

Qt xcb error? #108

GalSang17 opened this issue Jun 20, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@GalSang17
Copy link

GalSang17 commented Jun 20, 2023

(py38) yangyang@ysd:~$ anylabeling
QObject::moveToThread: Current thread (0x55efb47d7980) is not the object's thread (0x55efb56c97e0).
Cannot move to target thread (0x55efb47d7980)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/cv2/qt/plugins" 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: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

my envs:
python=3.8
PyQt=5.15.7

@vietanhdev
Copy link
Owner

@GalSang17 You can try the following commands:

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip install opencv-python-headless

Source: NVlabs/instant-ngp#300.

@vietanhdev vietanhdev added the bug Something isn't working label Jun 20, 2023
@GalSang17
Copy link
Author

GalSang17 commented Jun 21, 2023

@GalSang17 You can try the following commands:

pip uninstall opencv-python
pip uninstall opencv-contrib-python
pip install opencv-python-headless

Source: NVlabs/instant-ngp#300.

yeah! it worked, just i can open this software, if i try to label anything by load a sam model, an error about cv2 will throw, so, if this software must use cv2, why unistall opencv-python , then can open this software?

Gtk-Message: 16:15:13.798: GtkDialog mapped without a transient parent. This is discouraged.
Traceback (most recent call last):
File "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/anylabeling/utils.py", line 15, in run
self.func(*self.args, **self.kwargs)
File "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/anylabeling/services/auto_labeling/model_manager.py", line 313, in _load_model
from .segment_anything import SegmentAnything
File "/home/yangyang/miniconda3/envs/py38/lib/python3.8/site-packages/anylabeling/services/auto_labeling/segment_anything.py", line 5, in
import cv2
ModuleNotFoundError: No module named 'cv2'

@vietanhdev
Copy link
Owner

@GalSang17 OpenCV has 4 packages for python: opencv-python, opencv-contrib-python, opencv-python-headless and opencv-contrib-python-headless.
The first two versions may cause some issues on some machines, mostly when used with PyQt.

@vietanhdev
Copy link
Owner

Install the headless version to use cv2:

pip install opencv-python-headless

Or

opencv-contrib-python-headless

@vongocminh778
Copy link

vongocminh778 commented Feb 26, 2024

sudo apt install libxcb-xinerama0 to fixed problem worked for me.

@prob1995
Copy link

sudo apt install libxcb-xinerama0 to fixed problem worked for me.

this works for me! thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants