# 'qSlicerScriptedLoadableModule' object is not subscriptable

**URL:** <https://discourse.slicer.org/t/qslicerscriptedloadablemodule-object-is-not-subscriptable/24881>\
**Category:** Development\
**Created:** [August 23, 2022, 10:21am UTC](https://discourse.slicer.org/t/qslicerscriptedloadablemodule-object-is-not-subscriptable/24881 "2022-08-23T10:21:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doodads](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Doodads](https://discourse.slicer.org/u/Doodads)\
**Post date:** [August 23, 2022, 10:21am UTC](https://discourse.slicer.org/t/qslicerscriptedloadablemodule-object-is-not-subscriptable/24881/1 "2022-08-23T10:21:17Z")

</div>

Hi all,

The following error was printed in the python interactor upon start-up after I added a custom module path to Slicer.

```auto
Traceback (most recent call last):
  File "~/CreateMesh/CreateMesh.py", line 43, in __init__
    self.smoothN = meshparams["smoothNumberOfIterations"]
TypeError: 'qSlicerScriptedLoadableModule' object is not subscriptable
TypeError: module() argument 'name' must be str, not qSlicerScriptedLoadableModule

```

Does anyone know what is the reason for this error? Below is a snippet of the custom module. Many thanks!

```auto
import numpy as np
import copy
import logging
import vtk, qt, slicer
from slicer.ScriptedLoadableModule import *
from ExtractCenterline import ExtractCenterlineLogic

class CreateMesh:

    def __init__ (self, meshparams={}):
          self.modelNodes = None
          self.imageNodes = None
          self.centerlines = None
          self.surface = None
          self.surfacePolyData = None
          self.mesh = None
          self.prevCenterlines = None
          self.prevSurface = None
          self.prevMesh = None
          self.meshErrorsMarkupsNode = None
          self.endPointsMarkupsNode = None
          self.inputSurfaceForCenterline = None
          self.networkPolyData = None
          self.networkModelNode = None
          self.networkCurveNode = None
          self.networkPropertiesTableNode = None
          self.centerlineModelNode = None
          self.centerlineCurveNode = None
          self.centerlinePropertiesTableNode = None
          self.voronoiDiagramModelNode = None
          self.clMaker = ExtractCenterlineLogic()
          self.meshMaker = CreateMeshLogic()

          self.smoothN = meshparams["smoothNumberOfIterations"]

```
