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

ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory #269

Open
Badrabu opened this issue Mar 31, 2024 · 2 comments

Comments

@Badrabu
Copy link

Badrabu commented Mar 31, 2024

Im using Sagemaker studio lab, its a managed notebook and still face the following error

~/.conda/envs/default/lib/python3.9/site-packages/ultralytics/yolo/engine/predictor.py in
30 from pathlib import Path
31
---> 32 import cv2
33
34 from ultralytics.nn.autobackend import AutoBackend

ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

@turbotimon
Copy link

In my case (on NixOS, but should work for other distros too) it was enough to install the headless version:

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

@SkalskiP
Copy link
Collaborator

SkalskiP commented May 2, 2024

Yup @turbotimon and @Badrabu the error you're encountering, ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory, typically occurs in scenarios involving GUI applications or libraries on systems that lack the necessary GUI support libraries. This can happen when using the GUI version of OpenCV on a non-GUI (headless) operating system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants