# Python Path Changing after configure

**URL:** https://discourse.paraview.org/t/python-path-changing-after-configure/4625
**Category:** ParaView Support
**Created:** [June 19, 2020, 5:02pm UTC](https://discourse.paraview.org/t/python-path-changing-after-configure/4625 "2020-06-19T17:02:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Mahdi\_Kooshkbaghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mahdi_kooshkbaghi/32/3669_2.png) [@Mahdi\_Kooshkbaghi](https://discourse.paraview.org/u/Mahdi_Kooshkbaghi)
#### Post date: [June 19, 2020, 5:02pm UTC](https://discourse.paraview.org/t/python-path-changing-after-configure/4625/1 "2020-06-19T17:02:00Z")

</div>

Hi all,  
I am trying to compile the paraview 5.8.0.  
`mkdir build`  
`cd build`  
`ccmake ../`  
All good till now. Set the flag:  
`PARAVIEW_USE_PYTHON *ON`  
`[c] configure`  
All passed. However cmake found  
`Python3_LIBRARY_RELEASE */usr/lib/libpython3.8.so`  
This is the python version controlled by the Linux installation.

I want to change it to my custom Intel Python.  
So I changed all the following:  
`Python3_LIBRARY_RELEASE */path_to_intelpython3/lib/libpython3.7.so`  
`_Python3_EXECUTABLE */path_to_intelpython3/bin/python3`  
`_Python3_INCLUDE_DIR */path_to_intelpython3/include/python3.7m`  
`_Python3_LIBRARY_RELEASE */path_to_intelpython3/lib/libpython3.7.so`

Press `configure` **and again everything changed back to 3.8.**

My Python environment is setup correctly. I am not using any virtual environment.  
When I type python in terminal, I get:  
`Python 3.7.4 (default, Nov 22 2019, 21:31:39) [GCC 7.3.0] :: Intel(R) Corporation on linux`

Some global information:  
`gcc (GCC) 10.1.0`  
`cmake version 3.17.3`  
`linux kernel 4.19.126-1`

I successfully compiled the paraview 5.6 with the same Intel Python distribution before updating GCC to the 10.1.0 version. Now the paraview 5.6 complains about somewhere in Exodus module that a function defined multiple times.

Thanks for help,  
Mahdi

---

<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: [June 19, 2020, 6:15pm UTC](https://discourse.paraview.org/t/python-path-changing-after-configure/4625/2 "2020-06-19T18:15:04Z")

</div>

ParaView now uses the new `FindPython` module. You can see the documentation for how to use the new module in [the CMake docs](https://cmake.org/cmake/help/latest/module/FindPython3.html).

> [@Mahdi\_Kooshkbaghi](#):
>
> Now the paraview 5.6 complains about somewhere in Exodus module that a function defined multiple times.

This was fixed more recently. [https://gitlab.kitware.com/vtk/vtk/commit/a9079bdccbb2165583d6773a5ed848427e2a38a8](https://gitlab.kitware.com/vtk/vtk/commit/a9079bdccbb2165583d6773a5ed848427e2a38a8)

---

<div class="post-metadata">

### Author: ![Mahdi\_Kooshkbaghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mahdi_kooshkbaghi/32/3669_2.png) [@Mahdi\_Kooshkbaghi](https://discourse.paraview.org/u/Mahdi_Kooshkbaghi)
#### Post date: [June 19, 2020, 8:18pm UTC](https://discourse.paraview.org/t/python-path-changing-after-configure/4625/3 "2020-06-19T20:18:25Z")

</div>

Thank you Ben.  
Sorry to ask again.  
To force cmake pointing towards the path I want, should I set some bash variables according to the new module, or I need edit the CmakeList and set some variable there?  
Thanks again.

---

<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: [June 19, 2020, 10:52pm UTC](https://discourse.paraview.org/t/python-path-changing-after-configure/4625/4 "2020-06-19T22:52:54Z")

</div>

You should be able to set the “input variables” listed there with `-D` arguments to CMake to get it to find the Python you want it to.

---

<div class="post-metadata">

### Author: ![Mahdi\_Kooshkbaghi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mahdi_kooshkbaghi/32/3669_2.png) [@Mahdi\_Kooshkbaghi](https://discourse.paraview.org/u/Mahdi_Kooshkbaghi)
#### Post date: [June 20, 2020, 5:39pm UTC](https://discourse.paraview.org/t/python-path-changing-after-configure/4625/5 "2020-06-20T17:39:32Z")

</div>

The @ben.boeckel solution is working.  
Here is some **dirty** hack I did to make it work for someone with similar problem.

1. `mkdir build`
2. `cd build`
3. `ccmake …/

- Change all the flags you want, such as `PARAVIEW_USE_PYTHON ON`.

1. Configure, press [c] till you receive the option [g] for Generate.
2. **Do not generate and just quit**.

Now

1. `cmake ../ -DPython3_EXECUTABLE=path_to_intelpython3/bin/python3 -DPython3_LIBRARY=path_to_intelpython3/lib/libpython3.7m.so -DPython3_INCLUDE_DIR=path_to_intelpython3/include/python3.7m -D_Python3_EXECUTABLE= path_to_intelpython3/bin/python3 -D_Python3_INCLUDE_DIR=path_to_intelpython3/include/python3.7m`
2. `make -j 4`

Best,  
Mahdi
