Problem Description
When running the program in the ROS package, it prompts that the file is not an executable file.
rosrun beginner_tutorials control.py
The error message is as follows:
[rosrun] Couldn't find executable named controller.py below ...
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] .../scripts/controller.py
In addition, after source, entering rosrun beginner_tutorials and pressing the tab key will not automatically prompt the .py file.
Solution
This problem occurs mainly because the .py file has insufficient permissions. The solution is as follows:
-
Open the command window, where the .py file is located, enter in the command window
chmod a+x xx.py
where xx is the name of your .py file.
-
Just run it again.