ros-drivers / axis_camera

Contains basic Python drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.
BSD 3-Clause "New" or "Revised" License
52 stars 75 forks source link

Explicitly use Python3 in shebang for teleop nodes #72

Closed jyang-cpr closed 2 years ago

jyang-cpr commented 2 years ago

It appears that catkin_python_install() is not working correctly in terms of selecting Python3 at runtime to run the teleop.py and teleop_speed_control.py, when the package is installed from deb/binary or with catkin_make install. This can be reproduced on a Noetic machine (e.g. my laptop and 2 Jackals) with:

sudo apt-get update sudo apt-get install ros-noetic-axis-camera rosrun axis_camera teleop.py

OR

cd ~/catkin_ws/src git clone -b noetic-devel https://github.com/ros-drivers/axis_camera.git cd .. catkin_make install source install/setup.bash rosrun axis_camera teleop.py

In both instances, ROS will complain with /opt/ros/noetic/bin/rosrun: /home/jyang/projects/test_ws/install/lib/axis_camera/teleop.py: /usr/bin/python: bad interpreter: No such file or directory

To fix this, we can just specify Python3 in the shebang.

This PR also removes the shebang in setup.py, since it is not necessary, as per: