Python UNO错误:在调用期间处理了二进制URP网桥
我试图用LibreOffice测试Python UNO api,它产生了一个奇怪的错误Python UNO错误:在调用期间处理了二进制URP网桥,python,python-3.x,archlinux,uno,Python,Python 3.x,Archlinux,Uno,我试图用LibreOffice测试Python UNO api,它产生了一个奇怪的错误 Traceback (most recent call last): File "<stdin>", line 16, in <module> __main__.RuntimeException: Binary URP bridge disposed during call shell returned 1 正如我在代码中提到的,这一行正在生成错误 smgr.createIns
Traceback (most recent call last):
File "<stdin>", line 16, in <module>
__main__.RuntimeException: Binary URP bridge disposed during call
shell returned 1
正如我在代码中提到的,这一行正在生成错误
smgr.createInstanceWithContext(“com.sun.star.frame.Desktop”,ctx)
我正在尝试使用python3在ARCH LINUX with KDE环境下构建它。此错误意味着LibreOffice崩溃或pyuno桥崩溃。您可以在中的Libreoffice代码中看到我们如何在内部使用pyuno进行连接。您是否同时使用了Libreoffice和python可执行文件,它们都是从同一版本的Libreoffice打包的?(当libreoffice更新时,我们出现了这个错误,我们指向了旧版本libreoffice中的python)
import socket
import uno
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
"com.sun.star.bridge.UnoUrlResolver", localContext )
ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop",ctx) //this line is generating error
model = desktop.getCurrentComponent()
text = model.Text
cursor = text.createTextCursor()
text.insertString( cursor, "Hello World", 0 )
ctx.ServiceManager