DearPyGUI callback raises number arguments error
See original GitHub issuePython code using dearpygui
that works in the interpreter, is raising a num arguments error for the Nuitka compiled version. Tested on Windows and Ubuntu with Python 3.9 and 3.10 with the same results - implying the issue is not related to Python version, c compiler, or OS.
I tried two versions of Nuitka, 0.7.7 and 0.8rc9,
$ python -m nuitka --version
0.7.7
Commercial: None
Python: 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0]
Flavor: Anaconda Python
Executable: /home/martin/miniconda3/envs/dearpygui/bin/python
OS: Linux
Arch: x86_64
Distribution: Ubuntu (based on Debian) 20.04.4
$ python -m nuitka --version
0.8rc9
Commercial: None
Python: 3.10.4 (main, Mar 31 2022, 08:41:55) [GCC 7.5.0]
Flavor: Anaconda Python
Executable: /home/martin/miniconda3/envs/dearpygui/bin/python
OS: Linux
Arch: x86_64
Distribution: Ubuntu (based on Debian) 20.04.4
pip
was used to install Nuitka.
dearpygui
version is 1.5.1. Install: pip install dearpygui
. dearpygui
Reproducible snippet,
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(height=200, width=200)
dpg.setup_dearpygui()
# works
def cb_button1(sender, app_data, user_data):
print(f"sender: {sender} {app_data} {user_data}")
class myClass(object):
def __init__(self):
pass
# throws num arguments error
def cb_button2(self, sender, app_data, user_data):
print(f"sender: {sender} {app_data} {user_data}")
myclass = myClass()
with dpg.window(label="Example", height=100, width=100):
dpg.add_text("Hello world")
dpg.add_button(tag="b1", label="Button1", callback=cb_button1)
dpg.add_button(tag="b2", label="Button2", callback=myclass.cb_button2)
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Output of program,
$ ./nuitka_01.bin
sender: b1 None None
TypeError: myClass.cb_button2() takes 4 positional arguments but 5 were given
- Provide in your issue the Nuitka options used
python -m nuitka --standalone --onefile nuitka_01.py
Issue Analytics
- State:
- Created a year ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Dear PyGui documentation - Read the Docs
Helper to manually clip large list of items. Increases performance by not searching or drawing widgets outside of the clipped region. Parameters. label...
Read more >MessageBox in DearPyGui - python - Stack Overflow
Is it possible to easily implement such a messagebox in DearPyGui ... callback = choiceAdd, user_data = [a]) dpg.add_button("subtract", ...
Read more >DearPyGui - Bountysource
DearPyGui: A GPU Accelerated Python GUI Framework ... DearPyGUI callback raises number arguments error when app is compiled with Nuitka $ 0.
Read more >List of issues - Issues with patch - Python tracker
ID Activity Status Creator
45950 8 months ago open christian.heimes
45847 8 months ago open christian.heimes
45193 8 months ago open taleinat
Read more >Making a Live Dev Environment in DPG - I Suck At Coding
We create an input window; The execution callback injects our code into the live program ... import dearpygui.core as c import dearpygui.simple as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix for this is in DPG, nothing Nuitka itself can do about it.
Well, or you could add a fake
self
argument to eat up theself
they provide, but I understand there is an upstream patch in the works. Thanks for this, helps me a lot. I wouldn’t have the time to do it, glad you are taking it on.