A solution for circular import

from prettytable import PrettyTable
x=Prettytable()
having python 3.12.4 and installed prettytable lib and still get circular imports when program excution what should i do?

Can you share the exception traceback for the circular import (as formatted text)?

By any chance do you have a file named prettytable.py somewhere on your import path that’s shadowing the prettytable package you installed and trying to import itself?

can i share a screenshot ?

super thank u yeh the problem was my file name was prettytable.py

Glad that solved it for you :slight_smile: .

For more detailed reference, see:

Screen shots of text have many problems, we cannot quote from a screen shot for example.

Please copy the text and post as pre-formatted text using the </> button.