More than likely you have a local document calendar.py that is imported rather than the module in the standard library.
Discover where by printing the module:
import calendar
print(calendar)
Now just rename that document, it is actually masking the standard library version.
Join the python online course fast, to learn python concepts in detail and get certified.