When trying to execute a python file through a paramiko SSHClient, I'm getting the error:
ImportError: No module named rospy
In the line of that file that contains the rospy import. I'm only getting this error when trying to run the code using paramiko i.e:
ssh=paramiko.SSHClient()
ssh.connect(ipaddress,22,username,pw)
stdin, stdout, stderr = ssh.exec_command('python path/to/file.py')
When executing the command through a terminal, it works as desired. I only get the import error when trying to use paramiko. I'm unsure as to why this is occurring and any assistance would be greatly appreciated. Thanks.
Edit: further tinkering and experimentation has shown that it is a path issue, but the path for both the computer I am using and the target device are the same, but when I run echo $PATH on paramiko, the path element /opt/ros/indigo/bin/ is not included