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) #644
... a call to an open-cv function within that function like cv2.namedWindow(... ) results in this error:
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
Current thread 0x00007fff9792c380 (most recent call first):
File "/Users/frak/git/myAppJar/virtualenv/lifx-lan-gui/lights.py", line 1010 in followDesktopPressed
File "/usr/local/lib/python3.9/site-packages/appJar/appjar.py", line 3783 in <lambda>
File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1892 in __call__
File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py", line 1429 in mainloop
File "/usr/local/lib/python3.9/site-packages/appJar/appjar.py", line 1886 in go
File "/Users/frak/git/myAppJar/virtualenv/lifx-lan-gui/lights.py", line 1593 in <module>
Abort trap: 6
Expected Behaviour
This used to work in a previous version of python (3.7 maybe) with no errors
I am currently using python 3.9.9 on Mac OS High Sierra
Version Information
Replace this with the result of running your code with the -v flag: python myCode.py -v
Bug Report
Context
When I click on a button that launches a thread/function:
... a call to an open-cv function within that function like
cv2.namedWindow(... )
results in this error:Expected Behaviour
This used to work in a previous version of python (3.7 maybe) with no errors I am currently using python 3.9.9 on Mac OS High Sierra
Version Information
Replace this with the result of running your code with the -v flag:
python myCode.py -v