/usr/bin/env: ‘python\r’: No such file or directory_在ros中python读取文件,no such file or directory: 'config-CSDN博客

执行 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

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐