Why did my python slicer extension module loading fail?

Operating system: Linux Mint Tara (Ubuntu 18.04 Bionic)
Slicer version: 4.10.0
Expected behavior: Loading of module or an explanation of why loading failed
Actual behavior: Module loading failed with no details

Hi All, I’m new to slicer development. When I try to load my slicer extension I get an error “Module loading failed”. Are there any more detailed logs that can help me fix this? This was previously working, and since it was last working I’ve updated the extension code and removed the module from Slicer > Edit > Settings > Modules. The following details steps I’m taking when I get the error:

  1. start Slicer
  2. select module Developer Tools > Extension Wizard
  3. click “Select Extension”
  4. choose my slicer extension directory
  5. a window pops up saying “The following modules can be loaded. Would you like to load them now?”
  6. I select the module I want to load (with “Add selected modules to search paths” checked) and click “Yes”
  7. Following error dialog pops up:

image

Is there any more information to pinpoint the cause of the error? Is the error in the python code or the CMakeLists.txt or something else?

I upgraded to Slicer 4.10.1 and the module loads successfully now.

1 Like

I reproduced this same problem in slicer 4.10.1. It seems that once a module is added and removed, attempting to add it will always result in the above “Module loading failed” error. Removing settings (e.g. ~/.config/NA-MIC/ as described at https://www.slicer.org/wiki/Documentation/Nightly/FAQ) resolved the problem.

Should I submit a bug report somewhere?

For a specific Slicer version, you need to add a module to additional module paths only once (the paths are stored in application settings ini file). Maybe this could be made more clear in the documentation.