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
hi
I’m having an error
C:\Users\SaGeR\PycharmProjects\untitled5\venv\Scripts\python.exe C:/Users/SaGeR/PycharmProjects/untitled5/demo.py
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?
hi
Yes, you have installed it as you explained on YouTube
PS C:\Windows\system32> pip list
Package Version
————- ———-
Click 7.0
Django 2.2.4
pip 19.2.1
PyQt5 5.11.3
PyQt5-sip 4.19.18
pyqt5-tools 5.11.3.1.4
python-dotenv 0.10.3
pytz 2019.2
setuptools 40.8.0
sqlparse 0.3.0
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?