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

执行 rosrun 文件名   时报错/usr/bin/env: ‘python\r’: No such file or directory

原因是因为该文件的代码包含代码:#!/usr/bin/env python  

ubuntu系统中会被会变成#!/usr/bin/env python\r,而\r会被shell当成参数,所以出现: /usr/bin/env: ‘python\r’: No such file or directory的报错。

解决方法

vi 文件名
:set ff=unix 
:wq

猜你喜欢

转载自blog.csdn.net/lian740930980/article/details/126162926