2
$\begingroup$

I can run system command from Mathematica with Run["command"]. But if the command starts windowed application then nothing happens.

For example Run["gnome-terminal"] does nothing.

How can I run external applications in graphical mode from Mathematica?


When I run RunProcess["gnome-terminal"] I get an error

<|"ExitCode" -> 127,
  "StandardOutput" -> "", 
  "StandardError" -> "/usr/bin/gnome-terminal: symbol lookup error: /usr/lib/x86_64-linux-gnu/libatspi.so.0: undefined symbol: g_type_class_adjust_private_offset"
 |>

I looked at the library libatspi.so.0:

$ nm -D /usr/lib/x86_64-linux-gnu/libatspi.so.0 | grep g_type_class

U g_type_class_adjust_private_offset
U g_type_class_peek_parent
U g_type_class_ref

So the symbol is defined in the library so I have no idea what is Mathematica complaining about.


I'm running on Ubuntu 14.04.

I tested few other applications other then gnome-terminal and some of them works and some of them don't..strange.

Applications that does not work

gnome-terminal, emacs, nautilus

Applications that work

Mathematica, xterm, emacs-24.5

Okay, it has to do something with graphical interfaces. The difference between emacs and emacs-24.5 is that it has a different GUI. Maybe one is using GTK and the other is not, I do not know.

$\endgroup$
  • $\begingroup$ It works for me. What value is returned by Run ? Try this: RunProcess[{"which","gnome-terminal"}] $\endgroup$ – george2079 May 13 '16 at 19:06
  • $\begingroup$ @george2079 Output is <|"ExitCode" -> 0, "StandardOutput" -> "/usr/bin/gnome-terminal ", "StandardError" -> ""|> $\endgroup$ – tom May 13 '16 at 19:56
  • $\begingroup$ And Run["gnome-terminal"] returns 32512 $\endgroup$ – tom May 13 '16 at 19:57
  • 1
    $\begingroup$ Try Run["LD_LIBRARY_PATH= command"]. $\endgroup$ – ilian May 15 '16 at 18:13
  • 1
    $\begingroup$ @ilian solution Run["LD_LIBRARY_PATH= command"] works for me $\endgroup$ – Fortsaint Nov 11 '18 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.