Installing PyROOT on Mac

Hi all,

I’m new to ROOT and PyROOT and am having some install issues. I downloaded ROOT 6.20/04 which seems to be working great. I’m having some issues now configuring PyROOT from within my virtual environment. I tried following the instructions from this source: https://root.cern.ch/root/htmldoc/guides/users-guide/ROOTUsersGuide.html#python-interface

$ ./configure <arch> [--with-python-incdir=<dir>][--with-python-libdir=>dir>]

but every time I tried to type ./configure into the terminal, I get
-bash: ./configure: No such file or directory

I think I am just fundamentally confused about what ./configure is supposed to be doing and would appreciate any help

Hi,
You downloaded a binary release of ROOT 6.20?

If so, you need to run source your_root_installation_directory/bin/thisroot.sh. After that, you should be able to to run Python and import ROOT.

Hi!
Thanks for your suggestion, unfortunately I was doing that and I get this segmentation fault when I try to runfrom ROOT import TH1

>>> from ROOT import TH1

 *** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/Users/ibhallaladd/Desktop/build/lib/libPyROOT.so] PyUnicode_InternFromString /var/folders/qr/5nvpwmhx0_l0mtr57kyrdt9h0000gn/T/python-build.20200517205209.21951/Python-3.7.3/Objects/unicodeobject.c:15307
[/Users/ibhallaladd/Desktop/build/lib/libPyROOT.so] PyROOT::CreatePyStrings() (no debug info)
[/Users/ibhallaladd/Desktop/build/lib/libPyROOT.so] PyInit_libPyROOT (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyImport_LoadDynamicModuleWithSpec (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _imp_create_dynamic (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyMethodDef_RawFastCallDict (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyCFunction_Call (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyFunction_FastCallKeywords (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] object_vacall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyObject_CallMethodIdObjArgs (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyImport_ImportModuleLevelObject (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyEval_EvalCode (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] builtin_exec (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyMethodDef_RawFastCallDict (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyCFunction_Call (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyFunction_FastCallKeywords (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] object_vacall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyObject_CallMethodIdObjArgs (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyImport_ImportModuleLevelObject (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyEval_EvalCode (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] builtin_exec (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyMethodDef_RawFastCallDict (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyCFunction_Call (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyFunction_FastCallKeywords (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] call_function (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] function_code_fastcall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] object_vacall (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyObject_CallMethodIdObjArgs (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyImport_ImportModuleLevelObject (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalFrameDefault (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _PyEval_EvalCodeWithName (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyEval_EvalCode (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyRun_InteractiveOneObjectEx (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyRun_InteractiveLoopFlags (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] PyRun_AnyFileExFlags (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] pymain_main (no debug info)
[/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python] _Py_UnixMain (no debug info)
[/usr/lib/system/libdyld.dylib] start (no debug info)
[<unknown binary>] (no debug info)

Hello,

Did you download a binary release of ROOT? If so, you need to check that the Python version ROOT was compiled for is the same you are using.

If you are building ROOT from sources, you need to make sure that ROOT is built against the Python version you are using, in this case Python 3.7:

/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python

At configure time, you can instruct ROOT to compile with that Python version by passing the CMake argument -DPYTHON_EXECUTABLE=/Users/ibhallaladd/.pyenv/versions/3.7.3/bin/python.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.