I am using ROOT v6_24_6 installed with miniforge3 on macOS Big Sur.
I was attempting to use PyKeras method in TMVA, but PyMVA initialization fails. I paste an iPython snippet that reproduces the crash, with error trace included.
(rootenv) $ ipython
Python 3.8.10 | packaged by conda-forge | (default, May 11 2021, 06:27:18)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.27.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from ROOT import TMVA
In [2]: TMVA.Tools.Instance()
Out[2]: <cppyy.gbl.TMVA.Tools object at 0x14d608dd0>
In [3]: TMVA.PyMethodBase.PyInitialize()
Error processing line 1 of /Users/rshara01-local/miniforge3/envs/rootenv/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/Users/rshara01-local/miniforge3/envs/rootenv/lib/python3.8/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "/Users/rshara01-local/miniforge3/envs/rootenv/lib/python3.8/importlib/util.py", line 14, in <module>
from contextlib import contextmanager
File "/Users/rshara01-local/miniforge3/envs/rootenv/lib/python3.8/contextlib.py", line 5, in <module>
from collections import deque
File "/Users/rshara01-local/miniforge3/envs/rootenv/lib/python3.8/collections/__init__.py", line 24, in <module>
import heapq as _heapq
File "/Users/rshara01-local/miniforge3/envs/rootenv/lib/python3.8/heapq.py", line 581, in <module>
from _heapq import *
SystemError: initialization of _heapq did not return an extension module
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
...
SystemError: initialization of _heapq did not return an extension module
Also tried with 6.24.06 and I can’t reproduce either (this is Ubuntu). Perhaps @moneta can try on a mac? I installed with conda create -c conda-forge --name root_624_6 root
@moneta was also able to reproduce with conda on MacOS but he has a different error (pointer being freed was not allocated).
I tried on a MacOS 10.15 with an installation of ROOT from source and I can’t reproduce, so it might be related to the Conda installation on MacOS. @chrisburr do you have an idea of what can be the issue here?
The resolved PyROOT issue I originally referenced suggests that similar issues can be expected for PyMVA as well in the presence of both static& dynamic libs. To quote Note that I will discuss PyROOT, but PyMVA will need the same treatment.
I wonder if that was already addressed? Apologies if it has been, and this is something unrelated.