How do I specify the version of Python3 for ROS2?
I'm new to ROS2. I've tried to install ROS2 from packages a few times and I've run into a lot of dependency issues. Recently I cleared out versions of ROS1 and I now have ros-eloquent-desktop installed.
The problem stopping me now is that I can't easily run Python programs. ros-eloquent-rclpy 0.8.3-1bionic.20191213.05 (amd64) supports only Python 3.6. However, I have Python 3.7 installed and it is the default. When I run something like "ros2 run demo_nodes_py listener", /usr/bin/python3 is used. That is a link to python3.7, so ros2 fails.
I can change the symlink to python3.6 and it works fine. I prefer to avoid that.
I tried changing ROS_PYTHON_VERSION from "3" to "3.6" but that seems to have no effect.
I also tried changing the interpreter for /opt/ros/eloquent/bin/ros2, but that was insufficient.
ros2 clearly depends on Python3.6. Is there a clean way of specifying this? Where should I have found it?