TypeError when creating an Effect

I created an Effect inside Segment Editor. I looked at other effects (both default effects and those in SegmentEditorExtraEffects) to create my effect. However, when I launch Slicer application, it gives the following error.

TypeError: init() takes 1 positional argument but 2 were given
TypeError: module.init() argument 1 must be str, not qSlicerScriptedLoadableModule
TypeError: init() takes 1 positional argument but 2 were given
Traceback (most recent call last):
File “/home/karthik/…/SegmentEditorBR.py”, line 27, in registerEditorEffect
instance.self().register()
AttributeError: ‘NoneType’ object has no attribute ‘register’

Although it does not affect the working of my effect (i.e., the effect is still functional), this error message is very annoying. It shows up in the Python Interactor upon launch of Slicer itself. Please suggest how to get rid of this error.

I created the effect through Extension Wizard. I modified the name of the effect but other than that I haven’t touched the other effect parameters.

1 Like

I have the same issue. I try to find out the cause of that problem for days and double checked my code multiple times. As Karthik has described: Error messages without any impact on the workflow.