When executing rosrun file name, an error is reported /usr/bin/env: 'python\r': No such file or directory
The reason is because the file's code contains the code: #!/usr/bin/env python
In the ubuntu system, it will be changed to #!/usr/bin/env python\r, and \r
will be used as a parameter by the shell, so /usr/bin/env: ‘python\r’: No such file or directory
an error of: will appear.
Solution
vi 文件名
:set ff=unix
:wq