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

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.