Unity-Technologies/Unity-Robotics-Hub

20.04 / noetic tutorial local install - python/python3 issue

pringithub opened this issue · 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

FSund commented

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}
)

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.

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