SlicerOpenCV currently installed cv2.pyd to the root directory, and currently import cv2 fails. A fix to this is to install it to the qt-scripted-modules folder, but I was wondering if there was any interest in adding the ability for an extension to add entries to the Slicer-XYZ.ini sections?
For example, the extension could add a path entry to the [PYTHONPATH] section.
Any scripted module that calls import cv2 could add the dll’s path to Python paths, but this, too, would be just a workaround.
For me, the main question is:
why cv2.pyd is installed into 26876-win-amd64-SlicerOpenCV-git8ea8ff1-2018-01-29\lib\Slicer-4.9\cv2.pyd instead of in a scripted module directory? (scripted module directories are already added to PYTHONPATH section)
if cv2.pyd current location is preferable for some reason, then why not add that location to PYTHONPATH section as well?
Not a perfect answer to your first point, but the extension packaging would have to assume that the directory is “qt-scripted-modules”. Probably a reasonable assumption, but if the scripted directory ever changed, the extension would break (extremely unlikely scenario, I agree).
At the moment, point two is not possible, and was the goal of this discussion.
Maybe it could be simpler to have settings aggregated from a folder: Slicer.(app,exe) would look in that folder and append search settings from all the .ini files contained within. I think this would mesh well with the extension manager, and could also make local developer workflow nicer: just symlink .ini files into the aggregate folder from local extension build trees.
Do you create an extension package and install it or you run from the build tree? If you run from the build tree: did you specify the additional launcher settings ini file on the command line when you started Slicer?