ParaView Python Version


(Patrick Avery) #1

Hi there,

I’m in the process of upgrading tomviz to the latest ParaView.

Previously, we would read these cmake definitions to get the python dependencies:


But I see that they do not exist anymore. Is there a way to get these with the latest ParaView? We want to make sure we use the same python that ParaView does.


(Ben Boeckel) #2

The VTK::Python target has the python library in use. It looks like we should probably export VTK_PYTHON_VERSION or something like that from vtk-config.cmake so that the executable can be found as well.

(Patrick Avery) #3

Do you know if I can get the python library and include directory into cmake variables by using get_target_property() on VTK::Python?

(Ben Boeckel) #4

There’s a Python${VTK_PYTHON_VERSION}::Python target. But since VTK_PYTHON_VERSION is missing… Though Python${VTK_PYTHON_VERSION}_VERSION should be in-scope.

(Ben Boeckel) #5

Yeah, let’s just export VTK_PYTHON_VERSION from vtk-config.cmake. That should allow everything to be accessible without having to spell it all out manually in VTK. Documentation should indicate how to get this.

(Ben Boeckel) #6

(Patrick Avery) #7

Okay. Well, I got the cmake variables from the ParaView cache using the method on the right side here:

Let me know if there is a simpler way to do it.

(Ben Boeckel) #8

That may be inaccurate. I recommend that if you’re asking ParaView’s build tree that you use PARAVIEW_PYTHON_VERSION since VTK_PYTHON_VERSION is set locally based on it. But, I recommend that that code disappear once VTK provides this variable.