# TypeError when creating an Effect

**URL:** <https://discourse.slicer.org/t/typeerror-when-creating-an-effect/21957>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [February 14, 2022, 2:06pm UTC](https://discourse.slicer.org/t/typeerror-when-creating-an-effect/21957 "2022-02-14T14:06:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@Karthik](https://discourse.slicer.org/u/Karthik)\
**Post date:** [February 14, 2022, 2:06pm UTC](https://discourse.slicer.org/t/typeerror-when-creating-an-effect/21957/1 "2022-02-14T14:06:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![DaoMaoDuc](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/daomaoduc/32/14067_2.png) [@DaoMaoDuc](https://discourse.slicer.org/u/DaoMaoDuc)\
**Post date:** [March 3, 2022, 7:38am UTC](https://discourse.slicer.org/t/typeerror-when-creating-an-effect/21957/2 "2022-03-03T07:38:06Z")

</div>

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.
