Hobbyist Toolkit

Showing results for 
Search instead for 
Did you mean: 

Run python script in LabVIEW LINX

Go to solution

Hello all,


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,





0 Kudos
Message 1 of 11
Accepted by topic author Goomba79

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.


RPi System Exec.jpg


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.

David Wilt
The New Standard LLC
Message 2 of 11

Hello David,


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!





0 Kudos
Message 3 of 11

Hi David,


sorry for the delayed reply.

I tried the ssh method you outlined and that it going thanks!

0 Kudos
Message 4 of 11



0 Kudos
Message 5 of 11


0 Kudos
Message 6 of 11

你做了什么来修复它? 发布您的解决方案!

0 Kudos
Message 7 of 11

@毛卫 wrote:


What was your issue?  It sounds like you are saying your issue is with the Raspberry Pi and not LabVIEW LINX.  You may want to start your own post if it is not released to this topic.

David Wilt
The New Standard LLC
0 Kudos
Message 8 of 11

Dear David,

  thanks for your solution, I follow you mentioned method has successfull


0 Kudos
Message 9 of 11


0 Kudos
Message 10 of 11