# How To Specify Python Interpreter for ParaView

**URL:** https://discourse.paraview.org/t/how-to-specify-python-interpreter-for-paraview/2424
**Category:** ParaView Support
**Created:** [August 14, 2019, 6:02am UTC](https://discourse.paraview.org/t/how-to-specify-python-interpreter-for-paraview/2424 "2019-08-14T06:02:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [August 14, 2019, 6:02am UTC](https://discourse.paraview.org/t/how-to-specify-python-interpreter-for-paraview/2424/1 "2019-08-14T06:02:29Z")

</div>

Hi, Guys,  
I have built a ParaView executable and added many python Macros to it.  
Then I want to distribute my executable to my friends. Everything works as expected except someone has Python 3.7 installed on his PC that paraview crashes when running Macros. I have tested that reinstall Python 3.6.5 will fix it.

**So my question is:**  
Can I specify a python interpreter for paraview(Specific version or packed with paraview executable), or compile a Paraview Executable in which python interpreter can be manually configured.

my build configurations:  
Win10  
Visual Studio 12 2013 Win64  
Python 3.6.5  
Qt 5.9

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 14, 2019, 7:55am UTC](https://discourse.paraview.org/t/how-to-specify-python-interpreter-for-paraview/2424/2 "2019-08-14T07:55:48Z")

</div>

> [@ymjia](#):
>
> Can I specify a python interpreter for paraview(Specific version or packed with paraview executable)

Not at run-time, at least not yet.

> [@ymjia](#):
>
> Or compile a Paraview Executable in which python interpreter can be manually configured.

Most definitely, set the cmake option `PYTHON_EXECUTABLE`

However, difference between Python 3.7 nd Python 3.6.5 are minimal, so maybe fixing the error is worthwhile.

---

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [August 14, 2019, 8:19am UTC](https://discourse.paraview.org/t/how-to-specify-python-interpreter-for-paraview/2424/3 "2019-08-14T08:19:59Z")

</div>

Thanks for your replay,  
I have debug the process, ParaView crash at Py\_InitializeEx(vtkPythonInterpreter.cxx:246) in vtkPythonInterpreter::Initialize().  
It seems that it cannot find python.exe for different version. So would it be possible to use Paraview compiled with PYTHON\_EXECUTABLE={python3.6} in a PC with python 3.7 installed?

btw, how does ParaView executable find python interpreter? Maybe modify Windows Register table entry or Environment Variable can make it works? Since I have tested my Macro code can run both in python 3.6 and 3.7.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 14, 2019, 8:21am UTC](https://discourse.paraview.org/t/how-to-specify-python-interpreter-for-paraview/2424/4 "2019-08-14T08:21:47Z")

</div>

Not supported, you will have to build ParaView yourself or figure out why your script is not working with Python 3.7

---

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [May 9, 2020, 5:16am UTC](https://discourse.paraview.org/t/how-to-specify-python-interpreter-for-paraview/2424/5 "2020-05-09T05:16:34Z")

</div>

I found the way to remove denpendency of python from cmake-installed paraview executable. Thanks to the exe Windows Installer:  
Just copy following file/folder from python\_dir(e.g. c:/python/python36/) to Paraview/bin/

- python3x.dll
- DLLs
- Lib

By doing so, Paraview become fully portable, no need for python installed on the target PC. **Thus no need to specify python interpretor version** (I went a wrong direction last year:).
