# What the loading order of scripted modules

**URL:** <https://discourse.slicer.org/t/what-the-loading-order-of-scripted-modules/33457>\
**Category:** Support\
**Tags:** python\
**Created:** [December 19, 2023, 10:14am UTC](https://discourse.slicer.org/t/what-the-loading-order-of-scripted-modules/33457 "2023-12-19T10:14:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fokatu](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@Fokatu](https://discourse.slicer.org/u/Fokatu)\
**Post date:** [December 19, 2023, 10:14am UTC](https://discourse.slicer.org/t/what-the-loading-order-of-scripted-modules/33457/1 "2023-12-19T10:14:54Z")

</div>

One of my module (“AAA”) need functions of another module (“BBB”), so I want the BBB module be loaded before AAA module.  
I add “BBB” in the AAA’s dependencies list as follows, but it seems not working.

```auto
class AAA(ScriptedLoadableModule):
    def __init__ (self, parent):
        ScriptedLoadableModule. __init__ (self, parent)
        self.parent.title = _("AAA")  
        self.parent.categories = [translate("qSlicerAbstractCoreModule", "Examples")]
        self.parent.dependencies = ["BBB"] # TODO: add here list of module names that this module requires

```

To verify this, I print a line at the end of the two modules init function. It appears that module AAA still loads first.

the output of python console is as follows

```auto
Python 3.9.10 (main, Nov 26 2023, 05:23:59) [MSC v.1935 64 bit (AMD64)] on win32
>>> 
AAA: init
BBB: init
Loading Slicer RC file [D:/3DSlicer/slicer.org/Slicer 5.6.0/bin/../.slicerrc.py]

```

How to load “BBB” first before “AAA” is loaded
