Home | News | Documentation | Download

How to execute a python file

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.18
Platform: Ubuntu18.04

How to execute a python file?I tried and have a problem like following picture:


It looks like the ROOT installation you use was built for Python2, but you are trying to run a PyROOT script with Python3, hence the error. Please try using Python2 or build ROOT for Python3.

If you move to a more recent version of ROOT (>=6.22), you will be able to build it for multiple Python versions. More info here:


I tried to use it with Python2 and it works!Thank You!
And i installed a root in the recent version!It has some bugs,but,its root file run without problem.