I am aware that this is a frequent issue which has been posted about before but I have yet to find a solution on this forum.
I am currently running Mac OS X 10.15.5 (Catalina) and have installed python via Pyenv which I have installed with Homebrew.
I am running Python 3.8.0 and it is the default python on my machine (“which python” returns “/Users/gabrielbridges/.pyenv/shims/python”).
My C and C++ compilers are the default CLANG compilers provided by OS X.
For all of my ROOT builds I have followed the standard cmake procedure:
- cmake /path/to/source -Dbuiltin_glew=ON DCMAKE_INSTALL_PREFIX=/Path/to/install
- make -j2
- make install
These steps work perfectly for install ROOT on my machine and when I launch root from my command line I have complete functionality.
For my initial installation attempt I did not specify a python interpreter path with the “PYTHON_EXECUTABLE” option but noticed that CMAKE found my pyenv interpreter
Found Python: /Users/gabrielbridges/.pyenv/shims/python (found version "3.8.0") found components: Interpreter Development
Found PythonInterp: /Users/gabrielbridges/.pyenv/shims/python (found version "3.8")
After completing installation I launched root from the command line and ran a few tests and everything worked (I even laughed a GEANT simulation which produces a root tree as an output and it ran perfectly), however, when I launch python and “import ROOT” I am met with a set fault error
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/usr/lib/system/libsystem_malloc.dylib] szone_size (no debug info)
[/Users/gabrielbridges/Root/root_install/lib/libPyROOT.so] PyUnicode_InternFromString /var/folders/dc/tyygd6sd395gk8f7qcpq00040000gn/T/python-build.20191105225251.16745/Python-3.8.0/Objects/unicodeobject.c:15323
[/Users/gabrielbridges/Root/root_install/lib/libPyROOT.so] PyROOT::CreatePyStrings() (no debug info)
[/Users/gabrielbridges/Root/root_install/lib/libPyROOT.so] PyInit_libPyROOT (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyImport_LoadDynamicModuleWithSpec (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _imp_create_dynamic (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] cfunction_vectorcall_FASTCALL (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyVectorcall_Call (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyFunction_Vectorcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] object_vacall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyObject_CallMethodIdObjArgs (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyImport_ImportModuleLevelObject (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyEval_EvalCode (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] builtin_exec (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] cfunction_vectorcall_FASTCALL (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyVectorcall_Call (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyFunction_Vectorcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] object_vacall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyObject_CallMethodIdObjArgs (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyImport_ImportModuleLevelObject (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyEval_EvalCode (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] builtin_exec (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] cfunction_vectorcall_FASTCALL (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyVectorcall_Call (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyFunction_Vectorcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] call_function (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] function_code_fastcall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] object_vacall (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyObject_CallMethodIdObjArgs (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyImport_ImportModuleLevelObject (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyEval_EvalCode (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyRun_InteractiveOneObjectEx (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyRun_InteractiveLoopFlags (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] PyRun_AnyFileExFlags (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] Py_RunMain (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] pymain_main (no debug info)
[/Users/gabrielbridges/.pyenv/versions/3.8.0/bin/python] Py_BytesMain (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)
[<unknown binary>] (no debug info)
After investigating I found a few users with identical problems to my own and the suggestion that my problem was a mismatch in my system’s python and the python being used by ROOT. I cleaned and reinstalled ROOT with the new cmake option “PYTHON_EXECUTABLE” pointing to my Python installation. I noticed no difference in the output from cmake and running “import ROOT” returns the same error as before.
My question to the ROOT forums is, has anyone faced this problem before and managed to resolve it? If so, how?
_ROOT Version: 6.20.04
_Platform: Mac OSX 10.15.5 (Catalina)
_Compiler: CLANG/CLANG++
_Python: 3.8.0