Hi all.
The problem I am facing is rather simple, but yet I have not managed to solve it for 2 days.
The situation is the following: I have built ROOT 6.12.06 from source on my Mac OSX High Sierra (10.13) with Python 2.7.10 preinstalled. This has worked taking into account [1].
Some days later, I needed to update python for some other application. Now it is version 2.7.15. In particular,
/usr/local/bin/python links to /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/Python. Of course, pyROOT does not work anymore (i.e. doing “import ROOT” in the python script gives the error
unknown8C8590C2EBA4:rootbuild conni$ python
Python 2.7.15 (default, May 1 2018, 16:44:08)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
import ROOT
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
So, what I did a couple of times now was to reset the path to the python environment and rebuild ROOT6 from source. I tried the following ways: First, I tried to change the link in the libPyROOT.so [2], which doesn’t work. Second, I tried to configure (and then rebuild from source) with --with-python-libdir and --with-python-incdir options [3], which also doesn’t work. Third, I added the path (/usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/Python) which anyway is linked to by /usr/local/bin/python explicitly to the path as first directory (i.e. before /usr/local/bin/python) [3-4], which also does not bring the desired result.
This I do not understand, because python seems to be picked up correctly in the configure step: below I print you the output of the ./configure script in the last iteration (adding the python path to $PATH and running configure without options):
Checking for PyROOT prerequisites … yes
Checking for Python.h … /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/include/python2.7
Checking for python2.7, libpython2.7, libpython, python, or Python … /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/lib
Btw everytime I build root, I build it according to [1].
Still: is there something I am missing or doing wrong?
Thank you for any advice!
heico
[1] - Problem building ROOT 6.12 on Mac OS X High Sierra - #7 by heico
[2] - Trouble importing pyROOT on Mac OS X 10.11.1 - #8 by edwrdg13
[3] - Trouble importing pyROOT on OSX 10.9 Mavericks
[4] - pyROOT: Fatal Python error: PyThreadState_Get - #3 by mrluca87