Set python interpreter for the python macro

Hi forum,
I have played around with the python macro function. But I can’t find an way to set the python interpreter which will used. For example on RHEL7 or 8 have both python 2 and 3 interpreter are available. So how can I switch/set the used python interpreter?

Thanks for help.

The python macro uses the Java Scripting API and currently rely on Jython, a Java implementation of Python. Unfortunately the Jython project is not very active anymore to say the least and is quite late when it comes to Python 3 support…

The way forward would be to find and experiment alternatives to Jython. I doubt any other Python implementation in Java exist but maybe there is good bridges that allows to execute scripts with cpython. The usual problem with those is that it makes hard if not impossible to use the XWiki API from the python script but the result is a lot closer to the result you would get with the official Python interpreter.