pthom / imgui_bundle

Dear ImGui Bundle: an extensive set of Ready-to-use widgets and libraries, based on ImGui. Start your first app in 5 lines of code, or less. Whether you prefer Python or C++, this pack has your back!
https://pthom.github.io/imgui_bundle/
MIT License
590 stars 62 forks source link

demo_hello_world.py fails due to circular import #227

Closed maxmbed closed 1 week ago

maxmbed commented 2 weeks ago

Hi,

I am encountering a problem to run python demo_hello_world.py. it likely fails due to a circular import problem.

➜  palette (.venv) python demo_hello_world.py
Traceback (most recent call last):
  File "/home/max/Development/Python/palette/imgui_bundle.py", line 1, in <module>
    from imgui_bundle import immapp
  File "/home/max/Development/Python/palette/imgui_bundle.py", line 1, in <module>
    from imgui_bundle import immapp
ImportError: cannot import name 'immapp' from partially initialized module 'imgui_bundle' (most likely due to a circular import)

I follow the installation instruction in virtual environment.

Python version is 3.12.3

Is this an usual problem ?

pthom commented 2 weeks ago

Hellon

No, this is not a usual problem. Did you install from source or did you install using pipy?

I just did an installation from both source or using pipy, and both worked. Could you try to install in a fresh environment? If it still fails, please give me a full summary of all the commands you run, + the OS.

maxmbed commented 1 week ago

Thanks for your feedback. It was installed using pipy.

I run demo again using another fresh environment and it works good.

Actually, I am stupid. I name the source file imgui_bundle.py . After rename it, the issue gone.