[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: openoffice-pyuno and external python programs

On Tue, 2007-10-16 at 13:06 +0200, Zoltan Kota wrote:
> Hi, 
> The openoffice.org-pyuno package installs uno.py and other files 
> under /usr/lib/openoffice.org/program/, so with the default installations 
> and settings importing uno.py from external python programs gives an 
> import error. Program specific patches could be used probably to add this 
> 'strange' path to pythonpath, but wouldn't be better to make available 
> these moduls for python at the openoffice level? See below what debian 
> does. 
> Any thoughts, ideas?

Hmm, what does 
readelf -d /usr/lib/python2.4/site-packages/pyuno.so | grep RPATH
say on debian ? Is there an absolute entry in there so get it to find
the libraries it needs ? 

One work-around might be to stick this at the top of the python program

import sys
import distutils.sysconfig
sys.path.append(distutils.sysconfig.get_config_var('LIBDIR') + \
import uno


> Zoltan
> ---------- Forwarded message ----------
> Date: Wed, 12 Sep 2007 23:18:19 +0200 (CEST)
> From: Zoltan Kota <z kota gmx net>
> Reply-To: Development discussions related to Fedora
>     <fedora-devel-list redhat com>
> To: Fedora devel <fedora-devel-list redhat com>
> Subject: openoffice-pyuno and external python programs
> Hi,
> Files from openoffice.org-pyuno are installed under
> /usr/lib/openoffice.org2.0. So, 'import uno' from python gives an import 
> error. How should we support external programs to use this module? Should 
> we patch the program to import uno.py from this directory 
> somehow? Or would be better to change the installation path in the 
> openoffice.org-pyuno package? 
> Debian for instance installs 
> /usr/share/pycentral/python-uno/site-packages/uno.py
> /usr/share/pycentral/python-uno/site-packages/unohelper.py
> /usr/lib/python2.4/site-packages/pyuno.so
> Zoltan

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]