Python scripting not available

Hi,

I am trying to run a Python macro in LibreOffice 3.3.0 RC4 on Windows 7,
but cannot get it to work.
When I try to run a macro from an ODS file with a shortcut tool bar
button (created in OOo), I get the message "The scripting language
Python is not supported". Python macros also do not show up in the
dialog under Tools->Macros->Organize Macros->Python. Not even the
pre-installed samples are listed there.

A few things I checked:
- OpenOffice.org 3.2 is installed in parallel; Python sample scripts
work there
- LibreOffice 3.3.0 RC4 is installed with Python-UNO bridge
- Sample scripts have been installed, as expected, in
<INSTALL_PATH>\LibreOffice 3\Basis\share\Scripts\python
- Output of <INSTALL_PATH>\program\python.exe -V is "Python 2.6.1"
- Modified <INSTALL_PATH>\Basis\program\pythonscript.py: set
LogLevel.use = LogLevel.ERROR and LOG_STDOUT = False, but no log.txt is
written

Currently, I find no open bug report addressing this issue, so I wonder
if it is still a configuration problem.

Kind regards,
Matthias

Hi :slight_smile:

Probably the quickest easiest way to check if it is a configuration problem is
to rename the .libreoffice config folder. See if the new defaults give the same
error. Then just copy the backup you just made back over the top of the new
config folder to get back to where you started.

Regards from
Tom :slight_smile:

21.01.2011 15:20, Matthias Erll пишет:

Hi,

I am trying to run a Python macro in LibreOffice 3.3.0 RC4 on Windows 7,
but cannot get it to work.
When I try to run a macro from an ODS file with a shortcut tool bar
button (created in OOo), I get the message "The scripting language
Python is not supported". Python macros also do not show up in the
dialog under Tools->Macros->Organize Macros->Python. Not even the
pre-installed samples are listed there.

A few things I checked:
- OpenOffice.org 3.2 is installed in parallel; Python sample scripts
work there
- LibreOffice 3.3.0 RC4 is installed with Python-UNO bridge
- Sample scripts have been installed, as expected, in
<INSTALL_PATH>\LibreOffice 3\Basis\share\Scripts\python
- Output of<INSTALL_PATH>\program\python.exe -V is "Python 2.6.1"
- Modified<INSTALL_PATH>\Basis\program\pythonscript.py: set
LogLevel.use = LogLevel.ERROR and LOG_STDOUT = False, but no log.txt is
written

Currently, I find no open bug report addressing this issue, so I wonder
if it is still a configuration problem.

Kind regards,
Matthias

Here is the bug report that concerns this: https://bugs.freedesktop.org/show_bug.cgi?id=32939 (maybe we should open a different bug?)
I also sent a email to the users lists: http://nabble.documentfoundation.org/unable-to-install-example-extension-on-Windows-td2298712.html
In short, there is an extension to test how the scripts in different languages work - https://bugs.freedesktop.org/attachment.cgi?id=42184 .
This extension seems to be not possible to install in LibO 3.3.0 rc3/rc4 due to the python script can't be registered.

Hi Clio,

thanks for your reply!

21.01.2011 15:20, Matthias Erll пишет:

I am trying to run a Python macro in LibreOffice 3.3.0 RC4 on Windows 7,
but cannot get it to work.
When I try to run a macro from an ODS file with a shortcut tool bar
button (created in OOo), I get the message "The scripting language
Python is not supported". Python macros also do not show up in the
dialog under Tools->Macros->Organize Macros->Python. Not even the
pre-installed samples are listed there.
[...]
Currently, I find no open bug report addressing this issue, so I wonder
if it is still a configuration problem.

Here is the bug report that concerns this:
https://bugs.freedesktop.org/show_bug.cgi?id=32939 (maybe we should
open a different bug?)

I had seen this one, but was not sure if it was related. However, the
discussion there made me think that some people might have Python
running in LibreOffice 3.3. If no one can confirm Python works at all in
Windows environments, I had been planning on opening a different bug.

I also sent a email to the users lists:
http://nabble.documentfoundation.org/unable-to-install-example-extension-on-Windows-td2298712.html
In short, there is an extension to test how the scripts in different
languages work - https://bugs.freedesktop.org/attachment.cgi?id=42184 .
This extension seems to be not possible to install in LibO 3.3.0
rc3/rc4 due to the python script can't be registered.

Same here. Works fine on my Mac LibO and OOo, but only in OOo under
Windows 7.

Kind regards,
Matthias

Hi Tom,

Probably the quickest easiest way to check if it is a configuration problem is
to rename the .libreoffice config folder. See if the new defaults give the same
error. Then just copy the backup you just made back over the top of the new
config folder to get back to where you started.

Thank you for the hint. I did that and re-configured the Java VM.
However, unfortunately still get the same error.

Kind regards,
Matthias

HI :slight_smile:

Ok, so we know you haven't broken it. So, is it time to file a bug-report?

I don't know about Python or Java (or both?) or about the platform you are
running on. I would guess that you have installed all the required python
libraries and stuff? In linux just installing any package requiring python
tends to bring in all the libraries needed for that package. Finding more, such
as developer's tools and debugging tools should be reasonably easy through the
package manager which gives clear descriptions about each package.

I think when you start talking about python and scripting then you really need
to get into chats with the devs rather than just the users lists so please file
a bug-report.

Regards from
Tom :slight_smile:

Yes, sounds like time to post a new separate bug-report. If the triaging dev
decides it is the same bug then they have easy tools for linking the reports
together. That tends to get done quickly during triage.

I think it is usually best to just post if you are in doubt and let it get
filtered.

Regards from
Tom :slight_smile:

21.01.2011 17:27, Tom Davies пишет:

Yes, sounds like time to post a new separate bug-report. If the triaging dev
decides it is the same bug then they have easy tools for linking the reports
together. That tends to get done quickly during triage.

I think it is usually best to just post if you are in doubt and let it get
filtered.

Regards from
Tom :slight_smile:

________________________________
From: Matthias Erll<merll@web.de>
To: users@libreoffice.org
Sent: Fri, 21 January, 2011 20:33:05
Subject: Re: [libreoffice-users] Python scripting not available

Hi Clio,

thanks for your reply!

21.01.2011 15:20, Matthias Erll пишет:

I am trying to run a Python macro in LibreOffice 3.3.0 RC4 on Windows 7,
but cannot get it to work.
When I try to run a macro from an ODS file with a shortcut tool bar
button (created in OOo), I get the message "The scripting language
Python is not supported". Python macros also do not show up in the
dialog under Tools->Macros->Organize Macros->Python. Not even the
pre-installed samples are listed there.
[...]
Currently, I find no open bug report addressing this issue, so I wonder
if it is still a configuration problem.

Here is the bug report that concerns this:
https://bugs.freedesktop.org/show_bug.cgi?id=32939 (maybe we should
open a different bug?)

I had seen this one, but was not sure if it was related. However, the
discussion there made me think that some people might have Python
running in LibreOffice 3.3. If no one can confirm Python works at all in
Windows environments, I had been planning on opening a different bug.

I also sent a email to the users lists:
http://nabble.documentfoundation.org/unable-to-install-example-extension-on-Windows-td2298712.html
l
In short, there is an extension to test how the scripts in different
languages work - https://bugs.freedesktop.org/attachment.cgi?id=42184 .
This extension seems to be not possible to install in LibO 3.3.0
rc3/rc4 due to the python script can't be registered.

Same here. Works fine on my Mac LibO and OOo, but only in OOo under
Windows 7.

Kind regards,
Matthias

Here it is: https://bugs.freedesktop.org/show_bug.cgi?id=33355

Am 21.01.2011 21:33, Matthias Erll wrote:

Same here. Works fine on my Mac LibO and OOo, but only in OOo under
Windows 7.

Kind regards,
Matthias

I run Python macros and one extension with LibO 3.3RC4.
Python macros require Unix line feeds and a global variable
g_exportedScripts = MyMacro1, MyMacro2,
listing all the routine names that are supposed to accessible.

Am 21.01.2011 23:28, Clio wrote:

Here it is: https://bugs.freedesktop.org/show_bug.cgi?id=33355

Works for me.
Extract the zip, install the oxt file contained in the extracted Demo folder, restart the office with some text document and call the macros from Tools>Add-Ons>Calling Scripts

22.01.2011 14:40, Andreas Säger пишет:

Am 21.01.2011 23:28, Clio wrote:

Here it is: https://bugs.freedesktop.org/show_bug.cgi?id=33355

Works for me.
Extract the zip, install the oxt file contained in the extracted Demo
folder, restart the office with some text document and call the macros
from Tools>Add-Ons>Calling Scripts

On Windows XP/Vista/7 with LibO 3.3.0 rc4?

Hi Andreas,

Am 21.01.2011 21:33, Matthias Erll wrote:

Same here. Works fine on my Mac LibO and OOo, but only in OOo under
Windows 7.

I run Python macros and one extension with LibO 3.3RC4.
Python macros require Unix line feeds and a global variable
g_exportedScripts = MyMacro1, MyMacro2,
listing all the routine names that are supposed to accessible.

I checked my scripts for that, although the "g_exportedScripts" is said
to be optional. Anyway, the pre-installed examples should run, but they
are not even shown in the dialog. I just tried WinXP and there it does
not work for me either. Could you please give us more details about your
system configuration such as OS (version, 32 or 64 bit), Java VM version
etc.?

Kind regards,
Matthias

Am 23.01.2011 00:02, Matthias Erll wrote:

I checked my scripts for that, although the "g_exportedScripts" is said
to be optional. Anyway, the pre-installed examples should run, but they
are not even shown in the dialog. I just tried WinXP and there it does
not work for me either. Could you please give us more details about your
system configuration such as OS (version, 32 or 64 bit), Java VM version
etc.?

Oh, sorry. I forgot.
Ubuntu 10.4 and some free Java:
# java -version

Am 22.01.2011 22:33, Clio wrote:

22.01.2011 14:40, Andreas Säger пишет:

Am 21.01.2011 23:28, Clio wrote:

Here it is: https://bugs.freedesktop.org/show_bug.cgi?id=33355

Works for me.
Extract the zip, install the oxt file contained in the extracted Demo
folder, restart the office with some text document and call the macros
from Tools>Add-Ons>Calling Scripts

On Windows XP/Vista/7 with LibO 3.3.0 rc4?

No, it's Linux.
Sorry.