ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

asked 2020-07-18 07:41:54 -0600

Shre gravatar image

i am following the wiki tutorial http://wiki.ros.org/ROS/Tutorials/Exa... running rosrun beginner_tutorials talker.py gives me the error /usr/bin/env: ‘python’: No such file or directory

i read somewhere that to fix it we have to change

!/usr/bin/env python to #!/usr/bin/env python3

i am using ubuntu 20.04 with ros noetic, pls update the wiki guides ThankYou

edit retag flag offensive close merge delete

Comments

@sloretzanswer should be the accepted one.

joao.aguizo gravatar image joao.aguizo  ( 2022-11-07 06:13:14 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2020-07-23 10:48:28 -0600

sloretz gravatar image

running rosrun beginner_tutorials talker.py gives me the error /usr/bin/env: ‘python’

Has the package been built? It looks like this error shouldn't happen. The tutorial uses catkin_install_python() to install the talker script, which will create a wrapper script that has the correct shebang for the version of ROS being used. rosrun will run that wrapper instead of the original script.

catkin_install_python(PROGRAMS scripts/talker.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

There's more info about what shebang should be used in the UsingPython3 guide.

pls update the wiki guides ThankYou

When you find out a solution, feel free to create a wiki account and edit the page.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-07-18 07:41:54 -0600

Seen: 11,689 times

Last updated: Jul 23 '20