0

I've created a tkinter app which shows dash plots as tabs using ttk.Notebbok. The app contains a new button, when the it's clicked a dash plot is started in a new daemon thread (because I want my Tk app to run) and open the url in tkinter using cef in a new tab.

But the problem is, when I click on the new button whilst the previous chart was loading everything crashes. And this is the error log.

Fatal Python error: PyEval_RestoreThread: the function must be called with the GIL held, but the GIL is released (the current Python thread state is NULL)

Python runtime state: initialized

Thread 0x00000518 (most recent call first):
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\site-packages\dash\_watch.py", line 36 in watch
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\site-packages\dash\dash.py", line 1419 in <lambda>
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892 in run
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954 in _bootstrap_inner
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 912 in _bootstrap

Thread 0x000032d0 (most recent call first):
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\selectors.py", line 315 in _select
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\selectors.py", line 324 in select
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\socketserver.py", line 232 in serve_forever
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\site-packages\werkzeug\serving.py", line 717 in serve_forever
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\site-packages\werkzeug\serving.py", line 961 in inner
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\site-packages\werkzeug\serving.py", line 1008 in run_simple
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 920 in run
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\site-packages\dash\dash.py", line 1699 in run_server
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892 in run
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954 in _bootstrap_inner
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\threading.py", line 912 in _bootstrap

Current thread 0x00000198 (most recent call first):
  File "c:\Throughput-Timing-Tool\UI\browser_screen.py", line 165 in message_loop_work
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 814 in callit
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892 in __call__
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1429 in mainloop
  File "c:\Throughput-Timing-Tool\UI\generate_screen.py", line 229 in generate_screen
  File "c:\Throughput-Timing-Tool\UI\webview.py", line 205 in generate
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892 in __call__
  File "C:\Users\hnagesw\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1429 in mainloop
  File "c:\Throughput-Timing-Tool\main_screen.py", line 24 in <module>
2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.