Bootstrap FreeKB - Python (Scripting) - Resolve "partially initialized module has no attribute (most likely due to a circular import)"
Python (Scripting) - Resolve "partially initialized module has no attribute (most likely due to a circular import)"

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter 5805b3 in the box below so that we can be sure you are a human.