greetings. i want to use root within python and followed the instructions here https://root.cern/manual/python/ which do not seem that complicated since root is already installed on my system. i can import root without problems in my python(scripts) BUT when i want to draw a canvas i get the standard notification
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
and the canvas is not drawn anywhere. i have the same problem on MacOS and im kind of stunned becaus i dont think its very complicated to use since i did some googlin around and everywhere it seems quite out of the box working. is there anything crucial i am missing? thanks in advance.
How did you run your Python code? In the Python prompt or via a script with python script_name.py?
If you don’t see the canvas, it’s probably because the Python process died. If you run your code from the Python prompt, you should see the canvas. If you run it as a script, you need to include the -i flag so the Python process is kept alive: python -i script_name.py.
thanks for your answer. I already was working in a python prompt, i also tried jupyter notebooks (python) and use pyROOT there but that was not helping either. I also found the “solution” you mentioned running scripts with python -i *.py while googling this but without success. does it matter which python version im running? On both devices i installed ROOT before trying to use pyROOT is that maybe affecting this problem? needless to say i gave up using pyROOT since it does not work, which is not bad per se since i can use root without problem but it would be a nice feature.