When I am running my python
program I am getting following error in my terminal.
Traceback (most recent call last):
File "./encryption.py", line 6, in <module>
from PySide6 import QtCore, QtWidgets, QtGui
ImportError: libOpenGL.so.0: cannot open shared object file: No such file or directory
How to solve it? The import statements in my program are
#!/usr/bin/env python3
import sys
import random
import re
import pyAesCrypt
from PySide6 import QtCore, QtWidgets, QtGui
ImportError: libGL.so.1: cannot open shared object file: No such file or directory but this is already installed and the latest version. NB: I am actually running this on Docker, and I am not able to check the OpenCV version.
The importerror: libgl.so.1: cannot open shared object file: no such file or directory mainly occurs because of the missing dependencies of cv2 when you build the application with Docker. These dependencies will be present in the local instance and thus you will not get this error.
run the following command, to install libopengl0 library it required to run the code. The problem is a bug in PySide 6, which is apparently caused by a bug in Qt 6. Until that's fixed, you have to install OpenGL separately from installing PySide 6.
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?
The problem is a bug in PySide 6, which is apparently caused by a bug in Qt 6. Until that's fixed, you have to install OpenGL separately from installing PySide 6.
I installed it on Ubuntu 20.04 with this command:
sudo apt-get install freeglut3 freeglut3-dev
run the following command, to install libopengl0
library it required to run the code.
sudo apt install libopengl0 -y
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With