Using ROOT in editors

_ROOT Version: 6.26/06
Platform: MacOS
Compiler: Not Provided


Hi, I’m new to ROOT and trying to use ROOT in sublime Text 3.
I successfully installed root, and added source ~/usr/local/bin/thisroot.sh to ~/.zshrc.
It worked fine as I could import ROOT in python when opening from the terminal. But I can’t import ROOT when using text editors such like sublime text. Is there a way to activate thisroot.sh in text editors?

What do you expect from “import ROOT when using text editors”?

As you can see, it works fine in the terminal while it doesn’t work in text editors. I’ve made certain that the Python PATH is the same in both cases.

In both cases, try:

import sys
print(sys.version)
import os
print(os.environ['PATH'])
print(os.environ['ROOTSYS'])
print(os.environ['PYTHONPATH'])

Thanks very much for your advise, but I think I’ll jsut use it in the terminal.

Hi @MITSUKI000 ,

and welcome to the ROOT forum!

The issue is that your zsh shell loads ROOT at startup (because of the source invocation you put in the .zshrc) but the shell opened by sublime does not load ROOT. As a guess, could the cause be that sublime uses bash instead of zsh? Or maybe it uses zsh but somehow it skips the invocation of your .zshrc. In any case calling source ~/usr/local/bin/thisroot.sh directly in the sublime shell at the beginning should make ROOT available.

Cheers,
Enrico

Thanks, I think this is indeed the problem. I manage to solve this problem by insalling the sublime plugin of zsh which allows me to open Sublime from the terminal.

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