Difference between revisions of "Using Python on Linux"

From Apache OpenOffice Wiki
Jump to: navigation, search
(OpenOffice.org on Debian)
(OpenOffice.org on Ubuntu)
Line 57: Line 57:
 
</code>
 
</code>
 
before invoking ''python''.
 
before invoking ''python''.
 +
 +
Please note that of todays writing the recent stable version [Feisty] is build "with-system-python". Therefore your ooo's python is identical to your systems python.
 +
Build log for i386 available from http://launchpadlibrarian.net/7260728/buildlog_ubuntu-feisty-i386.openoffice.org_2.2.0-1ubuntu3_FULLYBUILT.txt.gz
  
 
[[Category:Python]]
 
[[Category:Python]]

Revision as of 13:53, 7 October 2007

Python is included on all major Linux however this is what we called as a system python might not relate with our OpenOffice.org python. The OOoPython is the one we need to know to install and learn where it is. The location will vary depending if you installed OOo from the OpenOffice.org Site or if it's comming from the distribution repository. We hope this document might help you identify your OpenOffice.org python within your setup.

OpenOffice.org Vanilla

OpenOffice.org installation from the site is usually the most common way to get the latest version of OOo. Distributions not always are quick to release the latest and greatest of the projects however because OOo doesn't require many dependencies it is easy to install on any Linux system.

The OOo installing can be reviewed on previous documentation already available from this wiki. We will focus more on how to locate and manage our OOo python enviroment.

The location for Python within OpenOffice.org from this type of installation is:

  /opt/openoffice.org2/program/python-core-2.3.4/

This implementation also includes some interesting python scripts such as:

  • python.bin
  • pythonloader.py and pyc
  • uno.py and pyc
  • unohelper.py and pyc
  • mailmerge.py
  • officehelper

We wont go under each script included but it is important to acknowledge for more indepth study of the bridge.

OpenOffice.org on Debian

The Debian version of OpenOffice.org usually installs OOo under

   /usr/lib/openoffice/

However note that Debians OOo is build "--with-system-python", which means ooo python is identical to your system python.

[build log for debian stable (etch) available from http://buildd.debian.org/fetch.cgi?&pkg=openoffice.org&ver=2.0.4.dfsg.2-5etch2&arch=i386&stamp=1180841081&file=log]

OpenOffice.org on Fedora Core

Fedora installs his OpenOffice.org version under:

   /usr/lib/openoffice.orgX.x/ (X.x being major and minor version).

The latest Fedora Core (release 6) ships with OpenOffice.org 2.0.4 as of this writing.

Fedora basic installs doesn't provide OO.org Python support unless you specifically select the package for install. Nevermind, you could easily install it later by using yum from a terminal, or pup if you're more familiar with Gnome tools. The package name is: openoffice.org-pyuno.

All Python scripts will be installed under the program folder.

Fedora Core's PyUNO package doesn't install a Python runtime environment, because the official up-to-date Python distribution always gets installed, and you could use that version instead. You will have to set the PYTHONPATH environment variable to use Python outside of OO.org; if you don't do that, the python executable will not find the pyuno libraries. From a terminal type: [bash] export PYTHONPATH="/usr/lib/openoffice.orgX.x/program" before invoking python.

OpenOffice.org on Ubuntu

Ubuntu installs his OpenOffice.org version under:

   /usr/lib/openoffice/ 

Ubuntu 6.06 Drapper installs OpenOffice.org Python package openoffice-uno by default.

All Python scripts will be installed under the program folder.

You will have to set the PYTHONPATH environment variable to use Python outside of OO.org; if you don't do that, the python executable will not find the pyuno libraries. From a terminal type: [bash] export PYTHONPATH="/usr/lib/openoffice.org/program" before invoking python.

Please note that of todays writing the recent stable version [Feisty] is build "with-system-python". Therefore your ooo's python is identical to your systems python. Build log for i386 available from http://launchpadlibrarian.net/7260728/buildlog_ubuntu-feisty-i386.openoffice.org_2.2.0-1ubuntu3_FULLYBUILT.txt.gz

Personal tools