Can't edit a custom module

Operating system: Windows 11
Slicer version: 5.2.2

Expected behavior:
Hello, I am trying to make a custom scripted module. After creating it if I press reload and test on the default template code it says test passed however I am not able to edit the code using the edit button or using the Python debugger.

Actual behavior:
If I press edit on the module then the command line opens and displays "No module named ‘logic’ " before closing and then nothing else happens as you can see in the picture below:
image

I also tried to edit the code using the Python Debugger. The python end appears to be working correctly, however the Slicer end asks me to select a debugger in the settings panel although I believe I have done this already.

image

Does anyone one know what could be causing these issues?

Thank you for your help

The “Edit” button opens the module .py file using the default application that you have configured for such files. It seems that you have not confgured an editor but instead you have associated it with a Python launcher (C:\windows\py.exe).

You have a couple of options:

  • change your operating system settings to associate .py files open with a text editor (so that they are opened in a text editor instead of launched on double-click)
  • do not use the Edit button and instead open the file manually
  • wait for this pull request to be merged (expected within a couple of days) that allows configuration of a custom editor for .py files
1 Like