Binded with PythonQt class not visible on Linux but visible on Windows (SlicerCAT)

Hi,

Among many classes that are successivle binded with PythonQt and accessible from python there are few that are binded but not accessible on Linux even though there are accessible on Windows.

For example there is a class called ColadaReader that is derived from QDialog and has default constructor.
On Windows this works as expected:

import qColadaAppPythonQt
reader = qColadaPythonQt.qColadaReader()

but the same project compiled on any Ubuntu 20.04 or CentOS 7 produce an exception:

import qColadaAppPythonQt
reader = qColadaAppPythonQt.qColadaReader()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
AttributeError: module 'qColadaAppPythonQt' has no attribute 'qColadaReader'

At the same time qColadaReader works as expected from C++ side.

To investigate the problem I list the exported symbols:

nm -D qColadaAppPythonQt.so

image

As you can see there is qColadaReader in the list.

Then I tried ldd qColadaAppPythonQt shows that there are some dependecies:
image
but paths to them are written in ColadaLauncherSettings.ini in [LibraryPaths] section so they should be loaded. And as I said it works from C++ side.

I also tried to explicitly add a decorator for that class but that didn’t helped. I think the class is binded but cant be loaded.

I’m a little bit confused but maybe somebody experienced have ideas what may be the reason of that?

I’ve found a problem.

qColadaReader is a base class for qColadaSegyReader.
qColadaReader is a class of qColadaApp library.
qColadaSegyReader is a class of a module qSlicerSeismicModuleWidgets.

If I build extenstion externally then qColadaReader is in qColadaAppPythonQt.
But if I build it during a Superbuild (application+extensions) then both qColadaReader and qColadaSegyReader are located in qSlicerSeismicModuleWidgetsPythonQt.

The question now is how to tell PythonQt to leave qColadaReader in qColadaAppPythonQt and qColadaSegyReader in qSlicerSeismicModuleWidgetsPythonQt

1 Like