07-14-2021 04:55 AM
Hi NI community. I am an absolute novice at both LabVIEW and Python, and I am trying to get a python script to run inside LabVIEW using the Python Node. I am using LabVIEW 18.0 32 bit, Windows 10 and have tried with both Python 3.9 and Python 3.6.
I have gotten the Python Node to work with a very simple Python script (a hello <name> type of script), and it worked flawlessly. However, problems seem to arise when trying to run a script where certain packages are being imported in Python. It seems to work fine when I am importing NumPy, but not when I try to import the mtcnn or tensorflow packages.
I get the following error message:
Error 1671 occurred at Python Node in LV_Python_Module.vi
Possible reason(s):
LabVIEW: (Hex 0x687) There was an error in executing the specified function.
Module Path: C:\Users\admin\Desktop\demo\scodyf_func.py
Function Name: scodyf_func
Python returned the following error: <class 'ModuleNotFoundError'>
No module named 'tensorflow'
The script works fine when I am running it in PyCharm, so I am guessing it has to do with the way I have set up the connection between LabVIEW and Python and perhaps where my packages are located, but I can't seem to fix it.
I have tried different approaches to make the script with the packages work, such as making sure that Python is included in PATH and using different versions of Python, but this did not work for me.
As mentioned, I am an absolute novice at both of these softwares, so I am hoping some of you can shed some light on might situation and hopefully help me fix it. Hopefully I have included all necessary information needed in this post, but let me know if otherwise.
Solved! Go to Solution.
07-15-2021 08:28 AM
The problem has been solved. The problem was with the packages themselves, as they did not support 32 bit, which both LabVIEW and Python were. I upgraded LabVIEW and Python to 64 bit and the problem was fixed.