Dear @Nemesis123 ,
Thank you for your nice insights!
So when I use VSCode, the default Python environment is different from the one on which the root was built. I further confirmed this by activating my environment in my
.bashrc
and now the notebook works in VSCode.
Yes indeed this is the main culprit, vscode won’t automatically source your ROOT installation, especially when you have built it manually and you need to run . thisroot.sh
to fill the environment.
So, let me try out to discuss possible ways out with you here, as I don’t know everything beforehand.
One possibility was already provided by you, probably vs code picks up the environment from ~/.bashrc
file so that allows using the jupyter notebook integration of vs code with the source ROOT installation.
I looked for this issue on SO and found this post which might help python - VSCode: Set environment variables via script - Stack Overflow . Specifically, this reply suggests changing some settings in vs code to inject a bash script when opening the terminal, which should be the thisroot.sh
file in your case.
Another alternative might be installing root via conda Installing ROOT - ROOT and then using that same conda environment in vs code.
Let me know if any of this helps,
Cheers,
Vincenzo