System Exec VI Hangs on macOS When Opening a Python Session

Updated Oct 29, 2026

Reported In

Software

  • LabVIEW

Other

macOS/OS X

Issue Details

When I execute the System Exec VI in LabVIEW on macOS while concurrently calling Open Python Session, the System Exec VI hangs and does not complete until the Python session is closed. Why does this happen, and how can I prevent System Exec from hanging? 

Solution

This issue does not reproduce on Windows. To work around this behaviour on macOS, use one of the following methods:

Ensure that the Python session is initialized and opened before invoking the System Exec VI:

  1. Add a Flat Sequence Structure frame prior to the parallel section of your code.
  2. Call Open Python Session inside this frame and pass the resulting Python session refnum to subsequent operations.
  3. In the following frame, run your Python operations and System Exec calls concurrently.
  4. Call Close Python Session only after all operations finish or during application shutdown.

Pre-opening the Python session ensures the helper process is already spawned before the System Exec stdout/stderr pipes are created, avoiding descriptor inheritance.

Method 2: Configure System Exec for Asynchronous Execution

If the Python session must be opened concurrently with the execution of the command:

  1. Wire a FALSE boolean constant to the wait until completion? input of the System Exec VI.
  2. If standard output or standard error data is required, redirect output to a file within the command line string (for example, /bin/mycommand > /path/to/logfile 2>&1), as the standard output and standard error output terminals of the System Exec VI will be empty when executing asynchronously.