/usr/bin/env: ‘python\r’: No such file or directory
When using WSL to write python code and then trying to run it from rosrun, this error code is encountered.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
When using WSL to write python code and then trying to run it from rosrun, this error code is encountered.
The problem are your line ending characters. Your file was created or edited on a Windows system and uses Windows/DOS-style line endings (CR+LF), whereas Linux systems like Ubuntu require Unix-style line endings (LF).
There is a simple tool that can convert the two different styles for you called dos2unix.
Install it by running
sudo apt install dos2unix
After that, you can convert files in either direction using one of the commands
dos2unix /PATH/TO/YOUR/WINDOWS_FILE
unix2dos /PATH/TO/YOUR/LINUX_FILE
Example:
dos2unix tf_list_conversion.py
Asked: 2021-08-30 08:29:22 -0500
Seen: 7,519 times
Last updated: Aug 30 '21
Cpp executeables only work with roslaunch, not rosrun, how can I fix this
Can wait_for_service bring up a service?
How to pass rosparam yaml file on rosrun cmd line
TF vs TF2 (lookupTwist vs lookup_transform)
How do I set up a baxter robot?
How do I solve the sklearn error