Installing a virtual env around LO Python

Jens Tröger jens.troeger at light-speed.de
Thu Feb 19 08:14:23 PST 2015


On Thu, Feb 19, 2015 at 05:45:58AM +0100, Jens Tröger wrote:
> What is the proper and recommended way of building a Python virtual
> environment around the LO Python?  I'd like to ensure that uno is
> available and functioning, while at the same time I can install
> additional packages into the venv?

I've tried the following on my Mac, without much success:

  > /Applications/LibreOffice64.app/Contents/MacOS/python -m venv test-venv

This does create a virtual env, but there is still no UNO available, and
I had to extend PYTHONPATH

  (test-venv) > PYTHONPATH=$PYTHONPATH:/Applications/LibreOffice64.app/Contents/MacOS ./bin/python

Following the instructions on this site

  http://askubuntu.com/questions/488529/pyvenv-3-4-error-returned-non-zero-exit-status-1/488530#488530

I downloaded the setuptools and pip for the virtual env.  However, I was
unable to locate matching version numbers: LO Python is 3.3.5 but I had
to work with 3.4.4 of the tools.  (Does that make a difference?)

However, when it came to installing packages, the venv falls apart.
Take lxml for example, which compiles some of its components natively.
It seems here that the build environment of LO is hard-wired into
Python, and of course that is a different one than mine: the log is
attached.

This is on my Mac which does have a Python interpreter built with LO.
On Linux, as far as I can tell, all I can do is extend my PYTHONPATH to
LO.

Cheers,
Jens

-- 
Jens Tröger
http://savage.light-speed.de/


More information about the LibreOffice mailing list