# ParaView Python Version

**URL:** https://discourse.paraview.org/t/paraview-python-version/1607
**Category:** Development
**Tags:** python
**Created:** [April 5, 2019, 5:52pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607 "2019-04-05T17:52:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Patrick\_Avery](https://discourse.paraview.org/user_avatar/discourse.paraview.org/patrick_avery/32/1301_2.png) [@Patrick\_Avery](https://discourse.paraview.org/u/Patrick_Avery)
#### Post date: [April 5, 2019, 5:52pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/1 "2019-04-05T17:52:01Z")

</div>

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:

```
ParaView_PYTHON_INCLUDE_DIR
ParaView_PYTHON_LIBRARY
ParaView_PYTHON_EXECUTABLE

```

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.

Patrick

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [April 5, 2019, 6:53pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/2 "2019-04-05T18:53:22Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Patrick\_Avery](https://discourse.paraview.org/user_avatar/discourse.paraview.org/patrick_avery/32/1301_2.png) [@Patrick\_Avery](https://discourse.paraview.org/u/Patrick_Avery)
#### Post date: [April 5, 2019, 7:15pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/3 "2019-04-05T19:15:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [April 5, 2019, 7:17pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/4 "2019-04-05T19:17:32Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [April 5, 2019, 7:18pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/5 "2019-04-05T19:18:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [April 5, 2019, 7:39pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/6 "2019-04-05T19:39:36Z")

</div>

[https://gitlab.kitware.com/vtk/vtk/merge\_requests/5373](https://gitlab.kitware.com/vtk/vtk/merge_requests/5373)

---

<div class="post-metadata">

### Author: ![Patrick\_Avery](https://discourse.paraview.org/user_avatar/discourse.paraview.org/patrick_avery/32/1301_2.png) [@Patrick\_Avery](https://discourse.paraview.org/u/Patrick_Avery)
#### Post date: [April 5, 2019, 8:11pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/7 "2019-04-05T20:11:15Z")

</div>

Okay. Well, I got the cmake variables from the ParaView cache using the method on the right side here: [https://github.com/OpenChemistry/tomviz/pull/1841/files#diff-af3b638bc2a3e6c650974192a53c7291R69](https://github.com/OpenChemistry/tomviz/pull/1841/files#diff-af3b638bc2a3e6c650974192a53c7291R69)

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [April 5, 2019, 8:59pm UTC](https://discourse.paraview.org/t/paraview-python-version/1607/8 "2019-04-05T20:59:22Z")

</div>

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](https://gitlab.kitware.com/paraview/paraview/blob/master/CMakeLists.txt#L316) based on it. But, I recommend that that code disappear once VTK provides this variable.
