_ROOT Version:root-6.16.00
_Platform: Windows Subsystem for Linux(Ubuntu 18.04 LTE) Compiler: cmake (3.10.2)
Hello everyone,
I’m a beginner of ROOT and all computing analysis.
I’ve already compiled ROOT with cmake and I would like to use pyROOT from python3.
So I Then, I got an error message below.
$ pyhton3
Python 3.6.7 (default, Oct22 2018, 11:32:17)
[GCC 8.2.0] on linux
I already searched the web and Stack Overflow but I couldn’t find any answer.
I have no idea to solve this error.
What does " segmentation fault " mean?
In particular, it is important to make sure you built ROOT with the Python3 installation you want to use. The following properties:
Python
PYTHON_EXECUTABLE
PATH
Python interpreter executable
PYTHON_INCLUDE_DIR
PATH
Directory where to find Python.h
PYTHON_LIBRARY
PATH
Full path to Python library
should point to the right Python installation. You can check if that is the case by inspecting CMakeCache.txt in your build directory and looking for the value of those properties.
Hi, all,
Just to add another data point here, I am having what seems to be the same issue. I’ve checked my CMakeCache.txt, and the environment variables are pointing to the correct places (as far as I can tell).
I’m on Mac OSX, running Anaconda python3.7. I’ve tried a fresh build of ROOT (6.16.00). cmake seems to get all of the environment variables correct on its own.
The error is manifesting as
mmcc @ ~> python
Python 3.7.3 (default, Mar 27 2019, 16:54:48)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ROOT import TVector3
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/anaconda3/lib/libpython3.7m.dylib] PyUnicode_InternFromString (no debug info)
[/usr/local/root_build//lib//libPyROOT.so] PyROOT::CreatePyStrings() /usr/local/root-6.16.00/bindings/pyroot/src/PyStrings.cxx:64
[/usr/local/root_build//lib//libPyROOT.so] PyInit_libPyROOT /usr/local/root-6.16.00/bindings/pyroot/src/RootModule.cxx:848
[/anaconda3/bin//python] _PyImport_LoadDynamicModuleWithSpec (no debug info)
[/anaconda3/bin//python] _imp_create_dynamic (no debug info)
[/anaconda3/bin//python] _PyMethodDef_RawFastCallDict (no debug info)
[/anaconda3/bin//python] PyCFunction_Call (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] _PyEval_EvalCodeWithName (no debug info)
[/anaconda3/bin//python] _PyFunction_FastCallKeywords (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] object_vacall (no debug info)
[/anaconda3/bin//python] _PyObject_CallMethodIdObjArgs (no debug info)
[/anaconda3/bin//python] PyImport_ImportModuleLevelObject (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] _PyEval_EvalCodeWithName (no debug info)
[/anaconda3/bin//python] builtin_exec (no debug info)
[/anaconda3/bin//python] _PyMethodDef_RawFastCallDict (no debug info)
[/anaconda3/bin//python] PyCFunction_Call (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] _PyEval_EvalCodeWithName (no debug info)
[/anaconda3/bin//python] _PyFunction_FastCallKeywords (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] object_vacall (no debug info)
[/anaconda3/bin//python] _PyObject_CallMethodIdObjArgs (no debug info)
[/anaconda3/bin//python] PyImport_ImportModuleLevelObject (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] _PyEval_EvalCodeWithName (no debug info)
[/anaconda3/bin//python] builtin_exec (no debug info)
[/anaconda3/bin//python] _PyMethodDef_RawFastCallDict (no debug info)
[/anaconda3/bin//python] PyCFunction_Call (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] _PyEval_EvalCodeWithName (no debug info)
[/anaconda3/bin//python] _PyFunction_FastCallKeywords (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] call_function (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] function_code_fastcall (no debug info)
[/anaconda3/bin//python] object_vacall (no debug info)
[/anaconda3/bin//python] _PyObject_CallMethodIdObjArgs (no debug info)
[/anaconda3/bin//python] PyImport_ImportModuleLevelObject (no debug info)
[/anaconda3/bin//python] _PyEval_EvalFrameDefault (no debug info)
[/anaconda3/bin//python] _PyEval_EvalCodeWithName (no debug info)
[/anaconda3/bin//python] PyRun_InteractiveOneObjectEx (no debug info)
[/anaconda3/bin//python] PyRun_InteractiveLoopFlags (no debug info)
[/anaconda3/bin//python] PyRun_AnyFileExFlags (no debug info)
[/anaconda3/bin//python] pymain_main (no debug info)
[/anaconda3/bin//python] main (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)
[<unknown binary>] (no debug info)
mmcc @ ~>
Here is the relevant content of CMakeCache.txt, if it’s useful:
//Path to a program.
PYTHON_EXECUTABLE:FILEPATH=/anaconda3/bin/python
//Path to a file.
PYTHON_INCLUDE_DIR:PATH=/anaconda3/include/python3.7m
//Path to a library.
PYTHON_LIBRARY:FILEPATH=/anaconda3/lib/libpython3.7m.dylib
//Path to a library.
PYTHON_LIBRARY_DEBUG:FILEPATH=PYTHON_LIBRARY_DEBUG-NOTFOUND
/usr/local/root_build/lib is in my PYTHONPATH, as well.
More info: Last night I installed a new Xcode (10.2.1), reinstalled Anaconda python (3.7), and rebuilt ROOT (6.16.00), and am having the same segmentation fault.
I installed anaconda3 in a different location, and the cmake configuration picked it up correctly.
Building ROOT and using Anaconda is a tricky combination. The compiler that you use to build ROOT should be the same compiler that Anaconda comes with.
In case you are interested, there is now a distribution of ROOT with Conda, which you can install with: conda create --name my-root-env --channel conda-forge python=3 root
Could you please paste here the output of otool -L path/to/libPyROOT.so? and the same for the python you use (i.e. otool -L $(which python)). That will help in debugging the problem.
mmcc @ ~>
mmcc @ ~> otool -L /usr/local/root_build/lib//libPyROOT.so
/usr/local/root_build/lib//libPyROOT.so:
@rpath/libPyROOT.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libpython3.6m.dylib (compatibility version 3.6.0, current version 3.6.0)
@rpath/libTree.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
mmcc @ ~>
mmcc @ ~> otool -L /anaconda3/bin/python
/anaconda3/bin/python:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
mmcc @ ~>
Looks like both refer to the same libSystem.B.dylib, but current versions are different. Strange since I installed both in the last few hours… or maybe (probably) I’m misunderstanding otool’s output.
Yes, the odd thing is that I had it working as recently as March (I think). I updated my Anaconda when I upgraded to TensorFlow 2.0, and that seems to have broken pyroot.
Since yesterday, I’ve tried several combinations of ROOT 6.16 and 6.14 with python3.6 and python3.7, with the same segmentation fault, so all signs are pointing to me having done something wrong during the install process. If I can’t locate the problem, I’ll give the Conda ROOT a try.