# PYTHON\_EXECUTABLE CMake variable

**URL:** https://discourse.paraview.org/t/python-executable-cmake-variable/13634
**Category:** Development
**Created:** [January 5, 2024, 2:37pm UTC](https://discourse.paraview.org/t/python-executable-cmake-variable/13634 "2024-01-05T14:37:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![guillaume\_Peillex](https://discourse.paraview.org/user_avatar/discourse.paraview.org/guillaume_peillex/32/10449_2.png) [@guillaume\_Peillex](https://discourse.paraview.org/u/guillaume_Peillex)
#### Post date: [January 5, 2024, 2:37pm UTC](https://discourse.paraview.org/t/python-executable-cmake-variable/13634/1 "2024-01-05T14:37:57Z")

</div>

Hi all,

I am currently working around ParaView and Spack and i realized that in the Spack’s ParaView recipe ([https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/paraview/package.py](https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/paraview/package.py)) the CMake variable `PYTHON_EXECUTABLE` is set (line 540).

I’m wondering about the validity of such variable because ParaView uses now `find_package(Python3 3.3 QUIET COMPONENTS Interpreter)` and so, IMHO, the correct variable to use should be `Python3_EXECUTABLE`.

By the way, from the comment in the paraview’s main CMakeLists.txt:

```auto
  # testing needs Python interpreter i.e. `PYTHON_EXECUTABLE` without which
  # our `find_python_module` checks to determine which tests to add or exclude
  # will fail. We find it here.
  find_package(Python3 3.3 QUIET COMPONENTS Interpreter)

```

and from close source inspection, it seems that the variable `PYTHON_EXECUTABLE` is still used at some places in VTK source tree.

Is this normal? Should i specify both variables (PYTHON\_EXECUTABLE and Python3\_EXECUTABLE) ?

Thanks in advance

---

<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: [January 5, 2024, 4:07pm UTC](https://discourse.paraview.org/t/python-executable-cmake-variable/13634/2 "2024-01-05T16:07:04Z")

</div>

No, `Python3_EXECUTABLE` should be used everywhere instead.

Cc: @Ryan_Krattiger

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [January 5, 2024, 10:04pm UTC](https://discourse.paraview.org/t/python-executable-cmake-variable/13634/3 "2024-01-05T22:04:50Z")

</div>

CC @vbolea @danlipsa
