ros2 / ros2/ros2cli

About specifying the Python path in a ROS2 config file

Open
#497 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

more-information-needed question
Dominant language
Python
Stars
262
Forks
228
Avg merge
23h 15m
Merged PRs (30d)
12

Description

Feature request

I want to specify the Python path in a ROS2 config file, so that the issues like https://github.com/ros2/ros2/issues/525 would not happen.

Feature description

I saw that in ROS2, the Python interpreter is specified by the first line in the .py script, like
#!c:\python37\python.exe.
So there is a assumption that everyone would install the Python according to the installation instructions, which means some developers like me cannot use a installed Python distribution, like Anaconda.

Implementation considerations

I think ROS2 could use a config file for us to specify the Python path, in maybe a .yamlfile, like:
PythonPath = C:\Python37\

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how ROS2 CLI tools select the interpreter from the first line of each .py script and read the linked ROS2 issue 525 for the reported problem. Compare that behavior with the proposed YAML configuration containing PythonPath. Done would require an agreed configuration location, precedence, format, and validation approach, none of which this issue currently specifies.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.