I am trying to run a script using an interface created with tkinter. I have a button that executes a script which code is:
subprocess.call("python3 " + PATH_TO_SCRIPTS + "main.py 1 &", shell=True)
However, when this button is pressed I am getting the following error.
Traceback (most recent call last):
File "/home/m//PycharmProjects/ROSAutonomousFlight/catkin_ws/src/ardrone_numeric_method_controller/scripts/main.py", line 17, in <module>
from controller import *
File "/home/m/PycharmProjects/ROSAutonomousFlight/catkin_ws/src/ardrone_numeric_method_controller/scripts/controller.py", line 5, in <module>
import rospy
It says that the module rospy does not exist, but when I run import rospy using python or python3 it is imported successfully. What can I do to solve this issue? I am using Ubuntu.
rospy.pyexist? Is it there in yoursys.pathorPYTHONPATH?rospyexists, compared tomain.py?from controller import *, and thisimport rospyis what I have in controller.py both py files are in the same directory. There is more code but here is where I am getting the error.