# qSlicerScriptedLoadableModule has no attribute named 'layout'?

**URL:** https://discourse.slicer.org/t/qslicerscriptedloadablemodule-has-no-attribute-named-layout/5564
**Category:** Support
**Created:** [January 29, 2019, 4:08pm UTC](https://discourse.slicer.org/t/qslicerscriptedloadablemodule-has-no-attribute-named-layout/5564 "2019-01-29T16:08:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)
#### Post date: [January 29, 2019, 4:08pm UTC](https://discourse.slicer.org/t/qslicerscriptedloadablemodule-has-no-attribute-named-layout/5564/1 "2019-01-29T16:08:49Z")

</div>

```
def setup(self):
    ScriptedLoadableModuleWidget.setup(self)
    # Joint collapsible button
    jointcollapsibleButton = ctk.ctkCollapsibleButton()
    jointcollapsibleButton.text = "Joints"
    #jointcollapsibleButton.enabled = False
    self.layout.addWidget(jointcollapsibleButton)

```

I try to write a py module like upper code. But when I add to slicer. I get an error:  
Traceback (most recent call last):

File "D:\Program Files\Slicer 4.11.0-2018-12-16\bin\Python\slicer\ScriptedLoadableModule.py", line 87, in **init**

self.layout = self.parent.layout()

AttributeError: qSlicerScriptedLoadableModule has no attribute named ‘layout’

---

<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: [January 30, 2019, 1:18am UTC](https://discourse.slicer.org/t/qslicerscriptedloadablemodule-has-no-attribute-named-layout/5564/2 "2019-01-30T01:18:57Z")

</div>

Can you find another error in the error log before this?  
Make sure you follow the latest extension module template (that works well).
