LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Simple Python Script to Work

Hi,

 

I am following the tutorial from this video: https://www.youtube.com/watch?v=YL-zGx6u0sQ. I finished adding all the components as the video said and have the same python code as in the video. However I'm getting a "Error 1672 occurred at Open Python Session in testingpython.vi. Labview (Hex 0x688) There was an unknown Python error in the operation."

 

I double checked and have everything as what the tutorial has, it is also frustrating that there is no way to inspect what the error is through Labview. Any help on why I am getting this error would be very helpful, thank you. 

Download All
0 Kudos
Message 1 of 3
(683 Views)

Where do you have you Python environment installed? I had issues when using something like Anaconda that installs Python in a non-default folder. Check here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000015C6tSAE&l=en-GB.

 

In LabVIEW 2023 you can specify a path to the Python installation folder, but I don't have experience with that.

 

Also make sure to specify the same Python version as the one you have installed.

0 Kudos
Message 2 of 3
(634 Views)

Thank you for the response. I am not using Anaconda, and also checked that Python is installed and connected to Labview because if I change the version number on the block diagram, it cannot find Python, proving that it finds the 3.10 version I have installed.

 

One thing I noticed is that after running, the block diagram highlights the last node of the block diagram. I changed the function to just return the input value and it does so, so I'm thinking I'm not closing off the block diagram properly if the last python node block is the issue?

 

Edit: I also added an error out and got this message but not sure what it means? 

Download All
0 Kudos
Message 3 of 3
(607 Views)