0

Am now on the third Open Office 4 installation this week, direct from their site, ensuring 'Python Uno' is selected. Whether running

C:\Program Files (x86)\OpenOffice 4\program\python-core-2.7.6\bin\python.exe

directly or setting it as the Eclipse interpreter

import uno 

keeps giving

no module named uno  

Whether browsing or searching the OOo python-core2.7.6 folder in the OS, the module can't be found. A 4 year old post had the same issue, and according to the docs it should be there. How do you install or activate PyUno in LibreOffice?

Any thoughts? Regards

Community
  • 1
  • 1
user2422819
  • 177
  • 13

2 Answers2

0

On Linux uno requires python3.
I see no reason why it would be any different on windows.
Try using python3

Rolf of Saxony
  • 21,661
  • 5
  • 39
  • 60
  • That's true for Linux. On Windows it's python.exe whether the version is Python 2 or 3. – Jim K Sep 12 '15 at 18:02
  • It might well be called python.exe but there must be one for python 2 and another for python 3, or we live in a mad mad world. – Rolf of Saxony Sep 13 '15 at 08:52
  • 1
    Well, they are at different locations. Anyway it is different on Windows, because python comes bundled with the OpenOffice installer. See [here](https://forum.openoffice.org/en/forum/viewtopic.php?f=45&t=36370&p=166783) for a discussion. – Jim K Sep 14 '15 at 17:01
  • @JimK Excellent, the more secondary documentation, in this case, the better! – Rolf of Saxony Sep 14 '15 at 18:25
0

Is there a directory C:\Program Files (x86)\OpenOffice 4\program\python-core-2.7.6? If not then you need to select the option to install the Python-UNO bridge when installing OpenOffice.

On Windows the paths need to be set up correctly. Try this in powershell:

c:
cd "C:\Program Files (x86)\OpenOffice 4\program\"
./python
>>> import uno

If that works then you can modify the PYTHONPATH environment variable to include the OpenOffice program directory as well as the path to your script.

Jim K
  • 12,824
  • 2
  • 22
  • 51