> /usr/local/bin/python3
Python 3.6.4 (default, Jan 6 2018, 11:51:15)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
>>> import uno
ModuleNotFoundError: No module named 'uno'
How to import uno with Python/macOS?
How to import uno with Python/macOS?
Any idea how to "import uno" within a Python script being managed by a system Python distribution?
OpenOffice 4.1.5 on macOS 10.12.6
Re: How to import uno with Python/macOS?
Use the Python interpreter that is shipped with the Office suite. It is Python3 with LibreOffice and Python2 with OpenOffice.
http://christopher5106.github.io/office ... acros.html
https://conference.libreoffice.org/asse ... sPyUNO.pdf
http://christopher5106.github.io/office ... acros.html
https://conference.libreoffice.org/asse ... sPyUNO.pdf
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: How to import uno with Python/macOS?
Thanks. But there is no python at my AOO installation - how to get it?
P.S. I'd still like to use a python interpreter chosen by me.> ll -1 /Applications/OpenOffice.app/Contents/MacOS/*python*
/Applications/OpenOffice.app/Contents/MacOS/pythonloader.py
/Applications/OpenOffice.app/Contents/MacOS/pythonloader.uno.dylib
/Applications/OpenOffice.app/Contents/MacOS/pythonloader.unorc
/Applications/OpenOffice.app/Contents/MacOS/pythonscript.py
OpenOffice 4.1.5 on macOS 10.12.6
Re: How to import uno with Python/macOS?
What about
Code: Select all
(PieceOfPathToThe_soffice.exe)\program\python-core-2.7.6
On Windows 10: LibreOffice 24.8.2 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: How to import uno with Python/macOS?
On my Xubuntu system, uno.py is at /opt/openoffice4/program; Normally, when a python script is opened as a macro in OpenOffice this is found automatically. If you wish to use it in the python interpreter (say for debugging), you should add that to your PYTHONPATH.
To find python on your computer, try "whereis python" and "which python" in a terminal (no quotes)
To find python on your computer, try "whereis python" and "which python" in a terminal (no quotes)
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
- MrProgrammer
- Moderator
- Posts: 5095
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: How to import uno with Python/macOS?
Hi, and welcome to the forum.
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
With no Python configuration on Mac OSX 9.5 and OpenOffice 3.2 I havepasza wrote:But there is no python at my AOO installation - how to get it?
~ $ find /Applications/OpenOffice.org.app/ -name uno.py
/Applications/OpenOffice.org.app//Contents/basis-link/program/uno.py
~ $ whereis python
/usr/bin/python
~ $ python -V
Python 2.7.5
As a test, try Tools → Macros → Run macro → OpenOffice macros → pythonSamples → TableSample → createTable → Run~ $ find /Applications/OpenOffice.org.app/ -name TableSample.py
/Applications/OpenOffice.org.app//Contents/basis-link/share/Scripts/python/pythonSamples/TableSample.py
That would seem to me to be a Python installation issue, not an OpenOffice issue.pasza wrote:I'd still like to use a python interpreter chosen by me.
If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: How to import uno with Python/macOS?
http://christopher5106.github.io/office ... acros.html explains LO-Python on the Mac and mentions the executable /Applications/LibreOffice.app/Contents/MacOS/python
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice