ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
When a package is being built it uses one specific Python interpreter. There is no option to perform two builds - one with Python 2 and one with Python 3.
A package can contain Python code though which works just fine with Python 2 as well as 3. Since the setup files extend the PYTHONPATH
you can use the packages Python API with both Python versions afterwards.
For a whole ROS distribution the decision of the Python major version is being made for the packaging of binary packages. For ROS 1 Melodic and older Python 2 is being used. For ROS 1 Noetic Python 3 is being used.
Maybe you can describe your concrete use case in more detail for a specific feedback.