Python file updates not seen after building and sourcing

For this kind of error, it could mean two things. Please try them in this order:

  1. You have properly built and sourced the module on one web shell, but it is not working on another.
  • You need to source ~/ros2_ws/install/setup.bash on the shell where you are running the program
  1. You have not properly built and sourced the package (please go through the steps and check again):
# On web shell 1
cd ~/ros2_ws
rm -rf install/ build/ log/
colcon build
source install/setup.bash

# On any other web shell
cd ~/ros2_ws
source install/setup.bash