/usr/bin/env: ‘python\r’: No such file or directory

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 \rwill be used as a parameter by the shell, so  /usr/bin/env: ‘python\r’: No such file or directoryan error of: will appear.

Solution

vi 文件名
:set ff=unix 
:wq

おすすめ

転載: blog.csdn.net/lian740930980/article/details/126162926