[vtkusers] Python 3 requires relative or correct absolute imports

Ben Boeckel ben.boeckel at kitware.com
Tue Oct 6 14:06:16 EDT 2015


On Mon, Oct 05, 2015 at 08:17:46 -0600, David Gobbi wrote:
> This assumes that the extension modules are installed in the same
> directory as the pure-python modules, which (for me at least) is
> generally not the case.  Often the extension modules are kept in
> a platform-specific directory somewhere else in the path.
> 
> Tonight I can look at the PEPs for this.

All of VTK's modules should go to the archful directory (/usr/lib64 or
/usr/lib/$triple). The .py files don't work without the .so files, so
they all go to the same directory (e.g., on Fedora,
/usr/lib64/python2.7/site-packages/vtk/*).

Python 3.3 introduced namespace packages where you can split a module
over multiple directories, but this is generally intended for the "find
all submodules of foo" use case for plugins where the foo package has a
presence on the archless and archful system directories as well as
$PYTHONPATH. But this is not the use case for VTK, so dropping the .py
files beside the .so files should be the way to go.

--Ben


More information about the vtkusers mailing list