With melodic you are expected to use python2.
With melodic you are expected to use python2.python2. Before you build again, make sure you delete the top-level devel and build directories in your catkin_ws.