Unity-Robotics-Hub icon indicating copy to clipboard operation
Unity-Robotics-Hub copied to clipboard

20.04 / noetic tutorial local install - python/python3 issue

Open pringithub opened this issue 2 years ago • 3 comments

Describe the bug ros code errors ad infinitum when running on a local 20.04 / noetic install due to python not referenced correctly.

To Reproduce Steps to reproduce the behavior: Install local ROS noetic / Ubuntu 20.04 build Run pick_and_place tutorial quick_demo - roslaunch niryo_moveit part_3.launch

Console logs / stack traces

/usr/bin/env: ‘python’: No such file or directory
[server_endpoint-2] process has died [pid 3112762, exit code 127, cmd /home/XXXXX/Projects/Tutorials/unity_ros/Unity-Robotics-Hub/tutorials/pick_and_place/ROS/src/ros_tcp_endpoint/src/ros_tcp_endpoint/default_server_endpoint.py --wait __name:=server_endpoint __log:=/home/pring5/.ros/log/aa238388-69b9-11ed-8f04-2db1b1a60ac8/server_endpoint-2.log].
log file: /home/pring5/.ros/log/aa238388-69b9-11ed-8f04-2db1b1a60ac8/server_endpoint-2*.log
[server_endpoint-2] restarting process
process[server_endpoint-2]: started with pid [3112763]

^ ad infinitum

Expected behavior Code should run without errors

Environment (please complete the following information, where applicable):

  • Unity Version: n/a
  • Unity machine OS + version: n/a
  • ROS machine OS + version: 20.04 / noetic
  • ROS–Unity communication: n/a
  • Branch or version: v0.7.0

Additional context Ubuntu 20.04 does not come with python as a command. Need to specify version. Suggestions to solve: include a symlink or install the python-is-python3 package as outlined below. At minimum, add a note to do this in a readme. https://stackoverflow.com/questions/3655306/ubuntu-usr-bin-env-python-no-such-file-or-directory/65059966#65059966

pringithub avatar Nov 21 '22 16:11 pringithub

Another solution is to add the following to ros_tcp_endpoint/CMakeLists.txt, and run catkin make

catkin_install_python(
  PROGRAMS
    src/ros_tcp_endpoint/default_server_endpoint.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

FSund avatar Mar 01 '23 11:03 FSund

Another solution is to add the following to ros_tcp_endpoint/CMakeLists.txt, and run catkin make

catkin_install_python(
  PROGRAMS
    src/ros_tcp_endpoint/default_server_endpoint.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

@FSund I still came across errors after running catkin_make. The initial solution to install python-is-python3 solved the problem.

paulonhantumbojr avatar Apr 17 '23 04:04 paulonhantumbojr

Another solution is to add the following to ros_tcp_endpoint/CMakeLists.txt, and run catkin make

catkin_install_python(
  PROGRAMS
    src/ros_tcp_endpoint/default_server_endpoint.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

@FSund Thanks! This worked for me

eswarijayakumar avatar Mar 05 '24 20:03 eswarijayakumar