PyQt Calender Widget Example
The QCalenderWidget displays a calendar like interface to display the year, month, and day. Using the Calendar Widget, we can easily let use to easily interact with different date values without the need to even type anything.
In this tutorial, I am going to show you how to build and use a Calendar widget using the PyQt5 in Python.
Python Code Snippet
I’m having an error
Traceback (most recent call last):
File “C:/Users/SaGeR/PycharmProjects/untitled5/demo.py”, line 4, in
from PyQt5.QtWidgets import QApplication, QWidget, QCalendarWidget
ModuleNotFoundError: No module named ‘PyQt5’
Process finished with exit code 1
Hi there. The error was caused by the Python script cannot find the the PyQt5 library. Have you installed the PyQt5 library before you started?
Yes, you have installed it as you explained on YouTube
PS C:\Windows\system32> pip list
Oh I see what’s going on there. You are trying to run your Python program in a virtual environment and you installed PyQt5 on the core environment.
Hello. We are not able to get values from the structure qDate.
I tried something like this -> self.selected_day = qDate.day()
But resulted in error.
Can you please help and returning / capturing these qDate values in variables.
What is the exact error message?