ERROR: cannot launch node of type [package/file.py]: can't locate node [file.py] in package [package]

This error is very common when using ROS to launch a python node, either via rosrun or roslaunch.

SOLUTION:

Does the file file.py

  • exist in the package package? If not, create it! (Does the package itself exist and is it spelled correctly?).
  • have execute permissions? If not, make it executable by running:
chmod +x /path/to/file.py  # replace '/path/to/file.py' by the real path of your file

my .py has exe. permitions and exist image

any idea bout my error?

@dev.dahb, please paste the full text of the error message here. Paste the full output of the terminal from the point where you ran the command to the point where the command exited due to the error.

I had the same issue, realized that I had not done chmod +x to my python file. after that it worked

1 Like