[Libreoffice] Use system python 2.6 on MacOS

Christian Lohmaier lohmaier+libreoffice at googlemail.com
Thu Oct 20 07:14:38 PDT 2011


Hi Aaron, *,

On Mon, Oct 10, 2011 at 8:03 PM, Aaron Richiger <a.richi at bluewin.ch> wrote:
>
> I'm using libreoffice 3.4.3, which comes with python 2.3 on MacOS.

Nah, that is not correct at all, please check what the actual problem is.

older versions did use the system version of python, and the version
compiled against was 2.3, but current versions ship with python 2.6.

I remember having raised the minimum python version myself.
http://cgit.freedesktop.org/libreoffice/core/commit/configure.in?id=d5ac53d4d47313dc37691839fe76fcc9858fea9f

and in later commits by Tor the support to compile against system
python (version 2.6 or later) when compiling against the 10.6 or later
SDK - but that is not the default).

A released build should come with a bundled version of python 2.6.

> But I
> need my 'normal' python 2.6 of the system because I have to import some new
> or other modules (subprocess, PySide, etc.) in my macros which are not
> supported with python 2.3!

See above. It never ever did *come with* python 2.3
When it was using python 2.3, it was using it from the system, while
on current versions of Mac OSX you cannot run python 2.3 from the
commandline, Mac OS X ships with a python 2.3 runtime that can be
invoked programmatically. (this make python macros run from within
LibreOffice run fine, but you could not use the api from outside,
unless you got a real python 2.3 installation like it is the case for
Mac OSX 10.4

But once again: current versions of LibreOffice come with python 2.6,
as python 3 compatibility changes made it necessary.

> Does anybody have any idea how to solve this and get rid of 2.3 but get 2.6
> working therefor?

See above. Invoke LibreOffice's python engine, using the python
command in the Application's folder. This will setup the necessary
environment variables and you should be able to work with it, and also
import your external, python 2.6 compatible stuff.

If you want to use system python 2.6, you need to set some variables
yourself, it's best to just look at the script that invokes LO's own
python.

ciao
Christian


More information about the LibreOffice mailing list