Less of a blog post and more of a reminder to myself that when Python says:
AttributeError: partially initialized module 'MODULE_NAME' has no attribute 'ATTRIBUTE_NAME' (most likely due to a circular import)
It is normally because I have named my Python file the same as the module I am importing and caused a circular reference. In this case I am looking at using the Python logging module and saved my Python file as logging.py, so when I then imported logging and tried to call on its functions it failed.
The solution is not to name the Python file the same as any of the modules being imported in that Python file.
You must be logged in to post a comment.