Click here to Skip to main content
15,904,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, coding guys,

as you saw in the title, my code returns a ImportError, here's the error below:

Traceback (most recent call last):
  File "main.py", line 1, in <module>
    from PyQt5.QtGui import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory


I am running this in Replit, but I don't know if this is something with the error.

But, anyways, here's my code:

What I have tried:

Python
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import Qt
import sys

class Window(QMainWindow):
	def __init__(self):
		super().__init__()
		self.setWindowFlag(Qt.FramelessWindowHint)
		self.setWindowTitle("Omega")
		self.setGeometry(100, 100, 400, 300)
		self.label_1 = QLabel('This is a test, please come back later.', self)
		self.label_1.move(100, 100)
		self.label_1.setStyleSheet("background-color: Tomato;border: 3px solid Red;")
		self.show()

App = QApplication("")
window = Window()
sys.exit(App.exec())
Posted
Updated 29-Mar-22 6:25am
v5
Comments
Richard MacCutchan 29-Mar-22 12:07pm    
The message is telling you that the GL library (presumably part of QtGui) cannot be found in your system. Check the documentation to see if it is an optional component.
Tyrunt.new("Rix") 29-Mar-22 12:11pm    
Where is the documentation? ( I'm really new to PyQt5 )
Richard MacCutchan 29-Mar-22 12:21pm    
Probably on the PyQt website. There is no point in trying to use a feature if you have not read the documentation.
Tyrunt.new("Rix") 29-Mar-22 12:22pm    
I can't find it on Google, sorry.
Richard MacCutchan 29-Mar-22 12:30pm    
Type PyQt or PyQt5 into Google.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900