A few days ago I tried to import ROOT inside my python shell, but it wouldn’t work so I was advised to use python 3 every time and in fact, it works well and it lets me import ROOT.
However, I found out that I cannot import any file anymore, even though I give the path to python via the sys.path.insert() command.
I don t really know about any remnant of their use in python2, see here is the thing: It is actually a folder inside my home directory so I guess I can access it using python 2 because it is just my home directory.
Can you check that the Python modules you want to use are in the PYTHONPATH?
To add directories with modules to your PYTHONPATH, you can do:
export PYTHONPATH=directory_with_modules:$PYTHONPATH
If a module is in the PYTHONPATH, for sure Python will find it when you import it.
Another thing to take into account is: did you install the modules that you want to use also for Python3? It might be the case that you installed them with Python2, now you moved to Python3 but the modules are not installed.
Yes, sure. The problem, in the end, was that I was not giving the full path, but only a part of it.
Once I gave the full path, it was working perfectly