I am running an algorithm in a python script using command line with --python-script command, which has a custom button created in slicer UI, when I trigger this button , algorithm will start, which is using multiprocessing and creating spawn type context object and runs several processes. When I did that I am getting error as below.
When I removed the places wherever I am using QtWidgets, DataProbe and DicomLib then the python script is running multiprocessing and algorithm successfully. These libraries are required for my complete functionality, so I can’t remove them. Please help me here.
Most objects are only usable on a single thread. Therefore, you usually cannot simply run the same code in a processing thread that works on the main thread.