Ask Your Question
0

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

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

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

1 Answer

Sort by » oldest newest most voted
0

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 6,261 times

Last updated: Jul 23 '20