Anyone tried Python 3.7?

(David Thompson) #1

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:

% ./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:

(Andrew Maclean) #2

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:

(David Thompson) #3

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.

(David Thompson) #4

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:

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

(Ben Boeckel) #5

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

(David Thompson) #6

Done: vtk #17434

(Marcus D. Hanwell) #7

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.