I need to run a python script that is stored on my raspberry pi.
In my LabVIEW code I am using the system exec vi and passing it the command python3 \home\pi\test.py.
however this isn't working. the standard error out put of the system exec vi out puts the following:
/bin/sh: python3: command not found
has anyone had any luck with getting a python script to run on a pi when called by Labview?
Thanks for looking,
Solved! Go to Solution.
I have not specifically tried to run Python code from LabVIEW code on the Raspberry Pi but I assume that you are having a pathing issue. Also, Python is not installed in the LabVIEW location so you might have issue running it from there even if you don't have a pathing issue.
My thought would be to run the code from the Raspberry Pi OS and send an ssh command from LabVIEW to run it. Now while you will be able to run the code like this I am not sure how well you will be able to change data between the Python code and LabVIEW code this way.
Here is an example of what I am doing to run an ssh command from LabVIEW.
In order to get this all to work you will need Chroot SSH trick and probably Run ‘sudo’ Command Without Entering a Password in Linux.
Thanks for the reply.
I'll have a look at the articles you linked and see if it gets me up and running.
I'll let you know how I get on!