Closed jhgorse closed 7 months ago
Hi,
Thanks for contacting me. I cannot reproduce your issue.
Based on your command line, I can diagnose several things:
(.venv) jhgs-MacBook-Air:pyimgui jhg$ cd /opt/work/pyimgui ; /usr/bin/env /opt/work/pyimgui/.venv/bin/python /Users/jhg/.cursor/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 49427 -- /opt/work/pyimgui/main.py
I happens inside a file/opt/work/pyimgui/main.py
, I do not know what is its content.
However, please note that imgui_bundle bindings are separate from pyimgui. They can coexist in the same virtual environment, however the following python code would fail!
import imgui # import imgui from pyimgui
from imgui_bundle import imgui # import imgui from imgui_bundle
As far as your error is concerned, here are the relevant lines:
File "/Users/jhg/.cursor/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_utils.py", line 32, in save_main_module
from imp import new_module
ModuleNotFoundError: No module named 'imp'
It seems to happen inside debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_utils.py
which is probably part of pydevd, and possibly installed by vscode (no idea about why it is inside /Users/jhg/.cursor/extension
)
It was an ambiguous choice of directory name, pyimgui, though I have evaluated 3 python bindings to dear imgui. I liked your bundle for the local debug-able c++.
I am using cursor.sh, a vscode clone. With the msft python extension. main.py is the imgui_bundle_demo.py code.
For some reason, the demo app on macOS arm64 python3.12 fails to launch the external code references. The above pydev errors are what I see after the new window fails to materialize.
When I resolve those errors by regressing back to python 3.11, the demo code works and launches as we would expect in the vscode debug environment.
Running without vscode on python3.12 works. The references code executes and windows appear.
It seems this is not your problem.
Excerpt:
ModuleNotFoundError: No module named 'imp'
when trying to run unloaded modules of python code.What the python hive mind has decided, FYI: https://discuss.python.org/t/how-do-i-migrate-from-imp/27885/28
Log for reference: