I made a package of my custom extension in the Debug version of the Slicer. Then, I use another PC to add it, I open Extensions Manager and install the package from .zip file. After restarting the Slicer, I can see my extension present in the Extensions Manager, but for some reason it is absent in Application Settings → Modules. Also, I noticed that no additional paths are added to the ‘Additional module paths’ section after installing the extension, but if I add the path to my module manually, it appears in the list.
Could you help me? What might be wrong, how can the path to the installed module be added automatically? Thank you!
Does the extension contain Python scripted modules or C++ loadable modules? If it contains anything C++, then you need to make sure that the configuration (Debug/Release), the Slicer revision, and actually all the DLLs in the environment are exactly the same. You can either submit the extension to the Extension Index and use it from the Slicer packages generated by the factory machines, or you can package the Slicer you used for building the extension, install it on the other computer, and then install the extension on that.
Actually, the module was built with Slicer 5.7, but I am installing it on a machine with Slicer 5.6. In the package, folders ‘Slicer-5.6’ used to be ‘Slicer-5.7’, but I tried to renamed them and check whether the module will be installed. Unfortunately, it didn’t work.
Is there a way to get the module work on Slicer 5.6 without rebuilding the Slicer at my development machine?
What you describe is not a nice solution but it should work. Is there any error in the Python console or the Error log related to your module after starting Slicer?
Checked the log at the Slicer startup, there are no error messages. It looks like Slicer is just unable to find the module due to absence of the path to it in ‘Additional module paths’ section in Settings.
When I add the module package using the Extensions Manager, it gets added to the folder with extensions! But for some reason path to it does not get added to ‘Additional module paths’. When I add the path to it manually, everything gets ok.
So the main question is how to add the path automatically but not manually. Unfortunately, the source code is not intended to be published
Unfortunately, this did not help. What I have just done was downloading another publicly available ‘ArduinoController’ module and adding in to the Slicer, but I did not succeed: the app gave an error to the Terminal. I am trying to add a Windows-based module in MacOS, but does it matter that much? It is written in Python by the way, so cross-platform behavior must be expected.
What else can I do to assemble the code of my personal module so that in could be added to Slicer on different machines? I have checked the directory structure multiple times, everything seems to be the same as in other modules, but still it does not work!
Can you install the ArduinoController extension package successfully?
If yes, then go back and start from there, change things step by step. For example, first change the extension name, try if still everything works. Then change the module name, try if still everything works. Then start changing the module content in small steps, after each small change try if everything still works. This makes it really easy to see where mistakes are made and how to fix them.
If you don’t want to do this then the alternative is to build Slicer and let the Slicer build system create the package for you.