find cli-modules path

FiberTractMeasurementsCLI = “/Applications/Slicer.app/Contents/Extensions-31382/SlicerDMRI/lib/Slicer-5.2/cli-modules/FiberTractMeasurements”
This is the path I need to use in the later code, but for other users, the path changes depends on the version of the Slicer they installed. So I use a command:
FiberTractMeasurementsCLI = glob.glob(“/SlicerDMRI/lib//cli-modules/FiberTractMeasurements”, recursive=True)[0] to search the path in the computer, but it takes too long time to find. I wonder if there are any command in Slicer which can find the path of the module installed.
By the way, the module is contained in DMRI.
Best wishes,
Joshua

I don’t have DMRI installed on this machine, but since the module you are running is a CLI, you should be able to do something like this:

>>> slicer.modules.modelmaker.path
'/Applications/Slicer-5.2.1.app/Contents/lib/Slicer-5.2/cli-modules/ModelMaker'

Replace modelmaker with fibertractmeasurements.