# How to use python script to install module in additional module paths?

**URL:** <https://discourse.slicer.org/t/how-to-use-python-script-to-install-module-in-additional-module-paths/33410>\
**Category:** Development\
**Tags:** python\
**Created:** [December 16, 2023, 3:02am UTC](https://discourse.slicer.org/t/how-to-use-python-script-to-install-module-in-additional-module-paths/33410 "2023-12-16T03:02:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![derekcbr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/derekcbr/32/18793_2.png) [@derekcbr](https://discourse.slicer.org/u/derekcbr)\
**Post date:** [December 16, 2023, 3:02am UTC](https://discourse.slicer.org/t/how-to-use-python-script-to-install-module-in-additional-module-paths/33410/1 "2023-12-16T03:02:49Z")

</div>

currentPaths = slicer.util.settingsValue(‘Modules/AdditionalPaths’, )  
if isinstance(currentPaths, str):  
currentPaths = [currentPaths]  
if modulePath not in currentPaths:  
currentPaths.append(modulePath)  
slicer.util.setSettingsValue(‘Modules/AdditionalPaths’, currentPaths)  
I try above code but it did not work. Is there a soultion? Thanks.

---

<div class="post-metadata">

**Author:** ![Raj\_Kumar\_Ranabhat](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/raj_kumar_ranabhat/32/9857_2.png) [@Raj\_Kumar\_Ranabhat](https://discourse.slicer.org/u/Raj_Kumar_Ranabhat)\
**Post date:** [July 23, 2024, 3:34pm UTC](https://discourse.slicer.org/t/how-to-use-python-script-to-install-module-in-additional-module-paths/33410/2 "2024-07-23T15:34:42Z")

</div>

@lassoan : Do you have solution for this work for python scripted module ?

---

<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:** [July 23, 2024, 6:34pm UTC](https://discourse.slicer.org/t/how-to-use-python-script-to-install-module-in-additional-module-paths/33410/3 "2024-07-23T18:34:08Z")

</div>

You can see how the Extension WIzard does it [here](https://github.com/Slicer/Slicer/blob/909126663f2ff3bbbe1ce56b5e445372a6406ae9/Modules/Scripted/ExtensionWizard/ExtensionWizard.py#L331-L405).

However, this should not be necessary and probably there are better ways. What are you trying to achieve?
