I installed the opengate library in python of 3DSlicer. But after importing it in python interactor and pressing the menu key or pressing the tab key for completing the names of imported libraries, on keyword, suddenly 3DSlicer crash and close, and I see below message in terminal.
sn@mph:~$ /home/sn/Slicer-5.8.1-linux-amd64/Slicer
Switch to module: "Welcome"
Python console user input: import opengate
nativeResourceForScreen: null screen
nativeResourceForScreen: null screen
Cannot create window: no screens available
error: [/home/sn/Slicer-5.8.1-linux-amd64/bin/SlicerApp-real] exit abnormally - Report the problem.
sn@mph:~$
Please guide me to solve it.
Best regards.
Shahrokh.
Pressing “Tab” key evaluates all attributes available in that module (to determine if they are callable functions and so parenthesis should be added after the name). If opengate is not implemented robustly then these evaluations cause a crash, which brings down the Slicer application.
I would recommend to find which exact attribute is implemented inappropriately by running this code in the Slicer Python console and then report that problem to opengate developers:
moduleName = 'opengate'
attributeNames = dir(moduleName)
for attributeName in attributeNames:
print(f"{attributeName}:")
print(f" value: {getattr(moduleName, attributeName)}")
print(f" callable: {callable(getattr(moduleName, attributeName))}")