Logging module not working with Python3

I stupidly created a file called logging.py to try out some log features. Then when trying the code below, it is effectively referring to itself and can't find the debug method.

import logging

logging.debug("Debug message")

Changing my file name to logtest.py fixed the problem.


You seem to have installed a third party library called logging in your Python 3 environment, which is hiding the standard library version, and one of its files has a typo.


logging module is by default there in Python 3 environment .No need to import it.