Ask Your Question
0

Python macros under Windows [closed]

asked 2014-08-21 19:36:33 +0200

freeo gravatar image

updated 2016-03-02 22:17:06 +0200

Alex Kemp gravatar image

I was trying to get a HelloWorld macro running under Windows 7 64 bit (German) with LO 4.3.0.4. Every macro under "My Macros" fails with the following popup error message:

pyuno._createUnoStructHelper: member 'Context' of struct type 'com.sun.star.uno.Exception' not given a value.

LibreOffices builtin Macros do work, only my custom macros under \AppData\Roaming\LibreOffice\4\user\scripts\python dont work.

I enabled logging on the ERROR level, which gave me this output:

Thu Aug 21 19:07:04 2014 [ERROR] ScriptBrowseNode.getPropertyValue error <class 'uno.com.sun.star.uno.RuntimeException'>: pyuno._createUnoStructHelper: member 'Context' of struct type 'com.sun.star.uno.Exception' not given a value.
  C:\Program Files (x86)\LibreOffice 4\program\uno.py:353 in function _uno_struct__init__() [struct, used = pyuno._createUnoStructHelper(self.__class__.__pyunostruct__,args,**kwargs)]
  C:\Program Files (x86)\LibreOffice 4\program\pythonscript.py:204 in function storageURI2ScriptUri() [raise RuntimeException( message )]
  C:\Program Files (x86)\LibreOffice 4\program\pythonscript.py:198 in function getScriptURI() [return self.storageURI2ScriptUri(storageURI)]
  C:\Program Files (x86)\LibreOffice 4\program\pythonscript.py:490 in function getPropertyValue() [self.provCtx.getPersistentUrlFromStorageUrl( self.uri + "$" + self.funcName ) )]

Just in case, I just installed JRE 8u20 before.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-02 22:17:28.126834

Comments

Try installing LO after the JRE. There are reports on this forum and elsewhere of an installation order of LO then Java causing problems. Seems unrelated to Python, but perhaps check this first.

oweng gravatar imageoweng ( 2014-08-22 07:41:56 +0200 )edit

I reinstalled LO again after JRE. This didn't change anything. But it's definitely a LO problem, I can execute the same python scripts with OO 4.1.1.

freeo gravatar imagefreeo ( 2014-08-26 15:38:28 +0200 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2015-09-16 20:40:03 +0200

kopiad gravatar image

Changing scripts to Scripts solved the issue for me. Change \AppData\Roaming\LibreOffice\4\user\scripts\python to \AppData\Roaming\LibreOffice\4\user\Scripts\python.

edit flag offensive delete link more
0

answered 2014-08-22 07:50:33 +0200

karolus gravatar image

Hallo

I can't recall similar Error-messages,

only my custom macros under \AppData\Roaming\LibreOffice\4\user\scripts\python dont work.

what exacty dont work ?
do you get the Functionnames visible on the GUI ?
If not - recheck carefully your code for common but "invisible" Syntaxerrors, like tab-signs instead of 4 spaces, missing closing parenthesis, missing colons as last sign in Statement-lines etcpp.

Sorry in case my trivial hints dont help you !

Karolus

edit flag offensive delete link more

Comments

The code is copied 1-to-1 from on official example. I simply moved it to the folder mentioned above. I just reinstalled LO 4.3.0.4. as well. The message is a popup I get, as soon as I execute the script: http://i.imgur.com/WGNN2UL.png I'd say that python support is simply broken in this particular version (newest right now) under Windows. What should I do next?

freeo gravatar imagefreeo ( 2014-08-22 13:51:20 +0200 )edit

Get the same error. Using LO 5.0.1.2 on Win 7 x64. Is also using a copy of a LO included example that runs fine in the LO installation directory. Are we missing some path?

kopiad gravatar imagekopiad ( 2015-09-16 20:34:24 +0200 )edit

I encounter the same problem on Win 7 x64 as well...

Metazeta gravatar imageMetazeta ( 2016-08-01 12:18:28 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2014-08-21 19:36:33 +0200

Seen: 2,874 times

Last updated: Aug 22 '14