ROOT from binary distribution - Python version

I’ve installed ROOT from binary and now I want to use PyROOT. I see that ROOT is installed with system Python which is Python 2.7.10 (/usr/bin/python) and it works, but I want to use newer version of Python - installed via homebrew, which is 2.7.15 (/usr/local/bin/python). Is there any way how to install ROOT on newer Python?

ROOT Version (6.12/06):
Platform, compiler (macOS 10.13, Apple LLVM version 10.0.0 (clang-1000.11.45.2)):

Can’t you simply switch the version of Python you start and import ROOT from there?

Sorry, that is not possible. ROOT has to be used with the version of Python that it was compiled for. If you want to use it with a different Python interpreter, you have to compile ROOT to use that interpreter. Also, you have to make sure to use the same compiler that was used to compile that Python interpreter, or libPyROOT will fail to link, because it needs to link both to libstdc++ and to libpython and these two libraries are only compatible with each other when compiled with the same compiler. Finally, it’s probably better to use ROOT 6.14 on Mac 10.13, and if you use homebrew, you can just brew install root to get the latest version without having to compile it yourself.

1 Like

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