Python macros under Windows

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.

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.

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.

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.

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

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?

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?

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