[EDIT]
For clarity - my question is how to force LibreOffice to use the Python version it is bundled with, as I am getting errors implying it is trying to use a different version of python.
I have found this happens on a lot of computers in my office, so I’d be surprised if no one else experiences it. However it may be that no one else tries to use the shell function extensively.
[/EDIT]
This is based on my initial problem here: Trying to replicate VBA shell functionality...
however I found it was caused by a deeper issue.
When I try to run shell commands - I get an error message (however the window vanishes too quickly, so I have to repeat the command multiple times and hit print-screen quickly).
It claims there is an error in C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\site.py line 173 The relevant line is
print("Error processing line {:d} of {}:\n".format(n+1, fullname),
file=sys.stderr)
The error message claims there is a syntax error on this line, however I would say that this is perfect syntax for python-3. BUT in python 2 this would be a syntax error - What’s New In Python 3.0 — Python v3.0.1 documentation
If I add the following line to the start
from __future__ import print_function
then that line no longer gives an error but something else then claims to have a syntax error.
This suggest to me my problem is simply that Libre is running things through python 2 rather than python 3 (I have python 2 installed on my system as the main version, and I don’t want to change it for numerous reasons).
Has anyone seen something like this, and knows how to change which version of python is being used?