1

I ran RunProcess[{"/usr/bin/kdialog", "--yesno", "Yes?"}] in Mathematica on a raspberry pi with kde and it gives me:

 "StandardError" -> 
  "/usr/bin/kdialog: relocation error: \
/opt/Wolfram/WolframEngine/12.1/SystemFiles/Libraries/Linux-ARM/Qt/\
plugins/platforms/../../lib/libQt5XcbQpa.so.5: symbol \
_ZN22QWindowSystemInterface25handleWindowScreenChangedEP7QWindowP7QScr\
een version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with \
link time reference
  "|>```

The command works fine in Konsole.

1 Answers1

0

From the Mathematica docs 'Possible Issues' section it looks like it's best to run this command like: RunProcess[{$SystemShell, optionC, "echo example line"}]. Which opens an appropriate shell (e.g. bash) which is able to run kdialog, which Mathematica isn't able to do directly.

The docs also say RunProcess inherits it's environment variables from the Wolfram Engine. I'd look into this if the above doesn't work..

  • ```RunProcess[{$SystemShell, "-c", "/usr/bin/kdialog --yesno Yes?"}]``` returns the same thing. – Emergency Temporal Shift Sep 22 '20 at 21:21
  • Open up a terminal and enter `echo $SystemShell`, if it returns nothing then you'll need to replace it with `/usr/bin/bash` (or your choice of shell). Have you ever successfully run `RunProcess` before with your RasPi? – sleeping-newton Sep 22 '20 at 22:42
  • ```RunProcess[{$SystemShell, "-c", "echo Test"}]``` Just returns "Test" like it's supposed to. The $SystemShell isn't a string passed to RunProcess, it evaluates in Mathematica to "/bin/sh" – Emergency Temporal Shift Sep 22 '20 at 23:29
  • What's the output of the following? `RunProcess[{$SystemShell, "-c", "echo $PATH"}]` in Mathematica and Konsole. `RunProcess[{$SystemShell, "-c", "echo $SHELL"}]` in Mathematica and Konsole. – sleeping-newton Sep 23 '20 at 00:17
  • Mathematica: "/opt/Wolfram/WolframEngine/12.1/Executables:/usr/local/sbin:/usr/\ local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games" Konsole: "/home/pi/kde/src/kdesrc-build:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games" – Emergency Temporal Shift Sep 23 '20 at 01:45
  • It says [here](https://reference.wolfram.com/language/ref/ProcessEnvironment.html) that environment variables come from the parent process (the Wolfram Engine), the problem is likely down to these variables being different to your user environment. For example, there's a good chance that `/home/pi/kde/src/kdesrc-build` needs to be in the `PATH`,for `kdialog` to be able to find the right version of libQt5. If you could launch the Wolfram Engine as your user (from Konsole), then Mathematica would inherit the right variables and then pass them on to it's child processes. – sleeping-newton Sep 23 '20 at 02:39
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/113309/discussion-between-emergency-temporal-shift-and-sleeping-newton). – Emergency Temporal Shift Sep 23 '20 at 02:52