/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,643 times
Last updated: Aug 30 '21
How to subscribe two topics and publish a topic?
How to record robot trajectory?
waitForTransform fails in Callback
Unable to install because of missing ninja
Visualize 2d objects in 2d image in rviz
Not able to create a map using SLAM Mapping( Kobuki+Hokuyo UST-10LX)