# Can't edit a custom module

**URL:** https://discourse.slicer.org/t/cant-edit-a-custom-module/30448
**Category:** Development
**Created:** [July 7, 2023, 11:25am UTC](https://discourse.slicer.org/t/cant-edit-a-custom-module/30448 "2023-07-07T11:25:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Poppy](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Poppy](https://discourse.slicer.org/u/Poppy)
#### Post date: [July 7, 2023, 11:25am UTC](https://discourse.slicer.org/t/cant-edit-a-custom-module/30448/1 "2023-07-07T11:25:51Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/e/0e0eb1e901e855950fea44f032a7d431e0f90484.png)

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](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/8/787c5ff7a39ec50bab102d5e5037d7b3a3cebe54.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/0/70719f72aaf2478f02108f583f1a55920228b2fc.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/5/158bef71a901c405d13aaf5777d6a10a9e01e99b.png)

Does anyone one know what could be causing these issues?

Thank you for your help

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [July 8, 2023, 2:26pm UTC](https://discourse.slicer.org/t/cant-edit-a-custom-module/30448/2 "2023-07-08T14:26:47Z")

</div>

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](https://github.com/Slicer/Slicer/pull/7074) to be merged (expected within a couple of days) that allows configuration of a custom editor for .py files

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [July 30, 2024, 9:20pm UTC](https://discourse.slicer.org/t/cant-edit-a-custom-module/30448/3 "2024-07-30T21:20:01Z")

</div>

A post was split to a new topic: [How to add and edit module](https://discourse.slicer.org/t/how-to-add-and-edit-module/37626)
