Parley says "Failed to determine interpreter for scriptfile" for all stock scripts on Mint 17 (with Python 2.7.6)

0

When I first tried using Parley 1.0.0 (which I had installed using the Software Manager in Mint 17, 32-bit), I downloaded many vocab files via the built-in mechanism, and when I tried the first one, it told me all five of the stock script add-ons failed, all with the message in the title. It also says that for any of them that I try to re-enable from Parley's menu item Scripts -> Script Manager.

If I open a terminal:

$ python --version
Python 2.7.6

So...I'm not sure what it means or how to fix it. (Wouldn't the interpreter for a .py file be Python? Why wouldn't it be able to find it on a stock install?)

The full error given is:

Error in file /usr/share/kde4/apps/parley/plugins/example.py at line -1: Failed to determine interpreter for scriptfile "/usr/share/kde4/apps/parley/plugins/example.py"

If I run Parley from a Terminal it gives more information, but the last line is all it spits out at the actual time of the error, and it doesn't give anything more than the popup did:

$ parley
Could not add child element to parent element because the types are incorrect.
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_lesson_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_wordtype_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_inflection_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_comparison_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_multiplechoice_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_synonym_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_antonym_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_falsefriend_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_pronunciation_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_image_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_summary_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_audio_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_browser_dock" with KXMLGUIFactory! 
parley(10341)/kdeui (kdelibs): Attempt to use QAction "show_latex_dock" with KXMLGUIFactory! 
parley(10341)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "google_images"
parley(10341)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "parley_example_script"
parley(10341)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "google_dict"
parley(10341)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "wiktionary_sound"
parley(10341)/kdecore (KPluginInfo) KPluginInfo::kcmServices: found 0 offers for "leo_dict"

(parley:10341): Gtk-CRITICAL **: IA__gtk_widget_get_direction: assertion 'GTK_IS_WIDGET (widget)' failed

(parley:10341): Gtk-CRITICAL **: IA__gtk_widget_get_direction: assertion 'GTK_IS_WIDGET (widget)' failed
Kross: "Error error=Failed to determine interpreter for scriptfile "/usr/share/kde4/apps/parley/plugins/example.py" lineno=-1 trace=
" 

The first line printed immediately. The following kdelibs lines printed when I clicked Editor (after loading a downloaded vocab file). The next five came when I clicked Scripts->Script Manager. The CRITICAL lines printed when I clicked to toggle the checkbox to the on position, next to Example Parley Script. The last line printed (and the error popped up) when I clicked OK.

Kev

Posted 2014-12-03T14:34:14.470

Reputation: 1 069

Googling Parley has a lot of pollution. – Kev – 2014-12-04T09:20:50.450

Answers

1

Bash doesn't set the interpreter based on the file extension. It uses the first line of the file, commonly referred to as the "shebang" or "crunchbang". This is what allows an executable python script to be run directly.

Some examples:

#!/bin/bash
#!/usr/bin/python2
#!/usr/bin/env python
#!/usr/bin/env ruby

You should inspect these "stock scripts" and see if they have a shebang line. If not, report it as a bug to the upstream project. I'm not familiar with parley, but you should also check if they have an option for a default interpreter.

carlwgeorge

Posted 2014-12-03T14:34:14.470

Reputation: 289

I didn't see any interpreter options. As for the scripts, the script manager does not appear to tell the location or even the exact filename of the script, and they weren't in ~/.kde/share/apps/kvtml like the vocab files, or anywhere near by that I could see. I'll keep looking... – Kev – 2014-12-04T09:17:54.917

http://api.kde.org/stable/kdeedu-apidocs/parley/html/namespaceScripting.html claims it can be found "usually" in /usr/share/apps/parley/plugins/ but that wasn't true either. – Kev – 2014-12-04T09:21:40.537

Yeesh, $ find / -type d -iname 'parley' found only ~/.kde/share/apps/parley, which I had also already tried (it contains only two files, neither are .py.) – Kev – 2014-12-04T09:24:56.963

Although, that kde.org link also shows their example script containing a shebang line like you had shown. Since the example script was one of the five stock plugins, which all fail, I think that this is probably not the cause of the failure. (Also, would a fully GUI KDE app use bash to invoke python anyway?) Nonetheless +1 for places to look. – Kev – 2014-12-04T09:27:21.137

Indeed I finally found them at /usr/share/kde4/apps/parley/plugins/, and example.py is just like on that page, starting with #!/usr/bin/env kross. – Kev – 2014-12-04T09:30:05.423

Oops, I hadn't noticed the original error popup gave the exact path. D'oh... – Kev – 2014-12-04T09:36:18.473

Per your suggestion, reported at https://bugs.kde.org/show_bug.cgi?id=341540 , in case it's not something I did wrong to set it up...

– Kev – 2014-12-04T09:45:03.343

1Do you have the kross command available? It is possible that it is a packaging error, where it is needed but not declared as a dependency of the package and thus not installed. – carlwgeorge – 2014-12-04T20:07:01.440

Tried it from a terminal and it lists its syntax, so apparently yes. – Kev – 2014-12-04T21:20:53.033