简体   繁体   English

在最新的Open Office安装中找不到Python Uno

[英]Python Uno Not Found On Latest Open Office Installation

Am now on the third Open Office 4 installation this week, direct from their site, ensuring 'Python Uno' is selected. 现在就可以直接从他们的站点进行本周的第三次Open Office 4安装,确保已选择“ Python Uno”。 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 直接或将其设置为Eclipse解释器

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. 无论是浏览还是搜索操作系统中的OOo python-core2.7.6文件夹,都找不到该模块。 A 4 year old post had the same issue, and according to the docs it should be there. 一个4岁的帖子有同样的问题,根据文档,它应该在那里。 How do you install or activate PyUno in LibreOffice? 如何在LibreOffice中安装或激活PyUno?

Any thoughts? 有什么想法吗? Regards 问候

On Linux uno requires python3. 在Linux上,uno需要python3。
I see no reason why it would be any different on windows. 我看不出在Windows上为何会有任何不同的原因。
Try using python3 尝试使用python3

Is there a directory C:\\Program Files (x86)\\OpenOffice 4\\program\\python-core-2.7.6 ? 是否存在目录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. 如果不是,那么在安装OpenOffice时需要选择安装Python-UNO桥的选项。

On Windows the paths need to be set up correctly. 在Windows上,需要正确设置路径。 Try this in powershell: 在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. 如果可行,则可以修改PYTHONPATH环境变量以包括OpenOffice程序目录以及脚本路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM