LabVIEW Hang While Executing Python Code with Multiprocessing Module

Updated Nov 29, 2024

Reported In

Software

  • LabVIEW

Programming Language

  • Python

Issue Details

I am executing my Python code with the multiprocessing module in LabVIEW using Python Node. The code worked fine in LabVIEW versions before LabVIEW 2023 Q1. However, when LabVIEW 2023 Q1 and above executes the Python code, LabVIEW will hang, and the VI cannot be aborted or stopped. This issue happens only when the multiprocessing.Manager method is called. Such behaviour does not happen if it is run directly from Python and this issue could be reproduce with LabVIEW using Python version 3.8 to 3.12. What should I do to resolve this issue?

Solution

NI is currently investigating this issue. As a temporary workaround, you may perform the following instructions. Do note that while using this temporary workaround, you will not be able to use the Python virtual environments feature that has been introduced at LabVIEW 2023 Q1.

  1. Navigate to the following directory:
    • For LabVIEW 32-bit: C:\Program Files (x86)\National Instruments\LabVIEW <Version>
    • For LabVIEW 64-bit: C:\Program Files\National Instruments\LabVIEW <Version>
  2. OpenĀ LabVIEW.ini with a text editor
  3. Include the following token into LabVIEW.ini:
    • PythonNode.UsePythonExecutable=False
  4. Save and close theĀ LabVIEW.ini
  5. Relaunch LabVIEW and execute the Python code