Python UNO import on Mac broken
Jens Tröger
jens.troeger at light-speed.de
Wed Feb 18 12:45:54 PST 2015
On Wed, Feb 18, 2015 at 08:53:14PM +0100, Michael Stahl wrote:
> On 18.02.2015 20:32, julien2412 wrote:
> > Just for the record, on MacOs 10.9.5, LO 4.3.5, Python 2.7.5, I don't
> > reproduce the segfault but have an error:
> > $ export PYTHONPATH=/Applications/LibreOffice.app/Contents/MacOS
> > i$ python
> > Python 2.7.5 (default, Mar 9 2014, 22:15:05)
> > [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import uno
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > File "/Applications/LibreOffice.app/Contents/MacOS/uno.py", line 21, in
> > <module>
> > import pyuno
> > ImportError: dynamic module does not define init function (initpyuno)
> >>>>
> >
> > But after having installed Python3 (3.4.1) with brew, I could reproduce
> > this:
> > $ python3
> > Python 3.4.1 (default, May 19 2014, 13:10:29)
> > [GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import uno
> > Segmentation fault: 11
>
> this is not at all surprising: the LO pyuno library is built against the
> bundled CPython and will not work with any other version that may be
> installed on the system because it will most likely not have the same C ABI.
Correct, you can import uno only in a Python 3.3.x environment. AFAIK
you can build your own LO for Python 2.7, that worked fine on Gentoo.
Even your import uno into a Py3.4 will cause problems when you begin to
import other modules.
There's some more info here:
http://stackoverflow.com/questions/15223209/installing-pyuno-libreoffice-for-private-python-build/
Jens
--
Jens Tröger
http://savage.light-speed.de/
More information about the LibreOffice
mailing list