Error 1667 Using Python Node and TensorFlow in LabVIEW

Updated Jun 18, 2024

Reported In

Software

  • LabVIEW

Programming Language

  • Python

Issue Details

LabVIEW shows the error 1667 when I use the Python node to call a Python function that imports the TensorFlow module because Python returns the error "AttributeError: module 'sys' has not attribute 'argv'.
 
image.png

Solution

To solve this specific Python error:
  1. Make sure that you have installed Python version 2.7 or 3.6.
  2. Copy the following piece of code:

                                                              import sys

                                                              if not hasattr(sys, 'argv'):

                                                               sys.argv = ['']
 

  1. Paste the copied code into the library "multi_process_lib.py" that is located in the following path:
             C:\Users\YOUR USER\AppData\Local\Programs\Python\Python36(or 27)\Lib\
             site-packages\tensorflow\python\distribute


The final code should look like this:
 

image.png

Note: Make sure that the line sys.argv = [''] has an indentation (a whitespace from the beginning of the row) you can do it if you place your cursor on the beginning of this row and press tab on the keyboard.
 
  1. Save it and run again the LabVIEW program.