No such file or directory (bad interpreter) when doing roslaunch or rosrun

i have the same error, i can launch the service directly from src folder. But launch is giving me the same error. I recreated a new package, did everything but still the same error

Hi @suhassamarth,

Thanks for contacting us and welcome to the Community!

Please give us the details of the error here. You can share a screenshot or copy/paste the output of the terminal.

PS: I moved your question to a new post to keep things tidy.

1 Like

Please give me your email, i’ll forward the package itself

Hi @suhassamarth,

There’s no need to forward the package at this point. It might just be simple problem. Please give the details here first.

Hi, please check the following:

  • is the file path correct?
  • is the Python file executable? Make it executable with chmod +x
  • try using rosrun instead of roslaunch and see if you get the same problem. If not, there’s a problem with your launch file?

this is what im getting

this is my launch file

Hi, when using rosrun, you specify the name of the executable file (the python file in this case), not the launch file. Can you try again?

Yes it gives success as output, but that’s not the point as we’ve to submit the quiz, and if the launch file isn’t working, there’s point right!?

Your rosrun isn’t working as well, pointing now to the Python file. The problem doesn’t seem to be with the launch file.

The problem seems to be with your Python file - the “shebang” line at the top. You should have something like the below there, but it seems you have something else ( usr/bin/bin or so) that’s throwing that error.

#! /usr/bin/env python

Thank you so much for the help, a single line caused me all these problems. Now i can move forward with quiz too

1 Like