Python (Scripting) - Resolve "partially initialized module has no attribute (most likely due to a circular import)"
by
Jeremy Canfield |
Updated: November 30 2023
| Python (Scripting) articles
Let's say something like this is being returned.
partially initialized module 'logging' has no attribute 'debug' (most likely due to a circular import)
The most likely reason for this is your Python script has the same name as a module you are trying to import. For example, perhaps you are importing logging.
#!/usr/bin/python3
import logging
And your python script is named logging.py. Bad idea!
python3 logging.py
Easy fix. rename your Python script and all should be well.
Did you find this article helpful?
If so, consider buying me a coffee over at