How to execute a python file


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.18
Platform: Ubuntu18.04
_Compiler:_default


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

Hello,

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:

Cheers,
Enric

Hello!
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.

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