# Anyone tried Python 3.7?

**URL:** https://discourse.paraview.org/t/anyone-tried-python-3-7/830
**Category:** Development
**Created:** [November 3, 2018, 3:30pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830 "2018-11-03T15:30:46Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dcthomp/32/20_2.png) [@dcthomp](https://discourse.paraview.org/u/dcthomp)
#### Post date: [November 3, 2018, 3:30pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830/1 "2018-11-03T15:30:46Z")

</div>

Hi all,

When I built recently with python 3.7 (macos, homebrew python), the python shell in ParaView works, but pvpython crashes on startup with:

```nohighlight
% ./bin/pvpython 
Fatal Python error: _Py_InitializeCore: main interpreter already initialized

Current thread 0x000000010c7ca5c0 (most recent call first):
zsh: abort ./bin/pvpython

```

I see the dashboards test python 3.5 and 3.6, but this may be new behavior for 3.7:

[https://bugs.python.org/issue33932](https://bugs.python.org/issue33932)

---

<div class="post-metadata">

### Author: ![Andrew\_Maclean](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@Andrew\_Maclean](https://discourse.paraview.org/u/Andrew_Maclean)
#### Post date: [November 4, 2018, 6:47pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830/2 "2018-11-04T18:47:55Z")

</div>

I haven’t tried it but hopefully it will be fixed in Python 3.7.1. As far as I know it is a known issue: [https://bugs.python.org/issue33932](https://bugs.python.org/issue33932)

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dcthomp/32/20_2.png) [@dcthomp](https://discourse.paraview.org/u/dcthomp)
#### Post date: [November 4, 2018, 11:07pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830/3 "2018-11-04T23:07:10Z")

</div>

Yes, I saw that issue but half of the discussion seems to be about changing the behavior of `Py_Initialize()` permanently so that double-initialization is no longer allowed. If `pvpython` is double-initializing then it seems like we should not.

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dcthomp/32/20_2.png) [@dcthomp](https://discourse.paraview.org/u/dcthomp)
#### Post date: [November 4, 2018, 11:40pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830/4 "2018-11-04T23:40:18Z")

</div>

I’ve looked in `VTK/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx` and it looks like we’re trying not to double-initialize, but in the debugger, `_Py_InitializeCore` is called twice, once from `vtkPythonInterpreter::Initialize` (when it calls `Py_InitializeEx`) and once from `vtkPythonInterpreter::PyMain` (when it calls `Py_Main`).

This pattern of calling `Py_Initialize` and then `Py_Main` appears mildly frowned-upon and the original issue above also links to these:

[https://bugs.python.org/issue34008](https://bugs.python.org/issue34008)  
[https://bugs.python.org/issue34206](https://bugs.python.org/issue34206)

which we should track since there may be changes in 3.8 after the 3.7 regression is fixed.

---

<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: [November 5, 2018, 3:11pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830/5 "2018-11-05T15:11:51Z")

</div>

Please file an issue in VTK CC’ing the usual Python folks to track this.

---

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dcthomp/32/20_2.png) [@dcthomp](https://discourse.paraview.org/u/dcthomp)
#### Post date: [November 5, 2018, 3:31pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830/6 "2018-11-05T15:31:50Z")

</div>

> [@ben.boeckel](#):
>
> Please file an issue in VTK CC’ing the usual Python folks to track this.

Done: [vtk #17434](https://gitlab.kitware.com/vtk/vtk/issues/17434)

---

<div class="post-metadata">

### Author: ![cryos](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cryos/32/846_2.png) [@cryos](https://discourse.paraview.org/u/cryos)
#### Post date: [November 7, 2018, 3:00pm UTC](https://discourse.paraview.org/t/anyone-tried-python-3-7/830/7 "2018-11-07T15:00:43Z")

</div>

I was looking at Python 3.7 too, and then came looking to see if others had issues. Glad I am not the only one, Arch Linux bumped recently.
