The only sure way you can get ROOT to work properly with anaconda is to use the same compiler that was used to compile anaconda’s Python. That is because anaconda’s Python links against its own standard library and if you use a different compiler it will try to link libPyROOT.so against it’s standard library and anaconda’s Python, which is trying to use the different (and very likely incompatible) standard library. That cannot work. You also need to make sure to not set your LD_LIBRARY_PATH
in a way that you’ll pick up the wrong libraries for Python (e.g., pick Python from anaconda and libraries from the system).