ros2_documentation icon indicating copy to clipboard operation
ros2_documentation copied to clipboard

📝 Explicitely state that PYTHONPATH should be manually updated in ros2 virtual environments

Open MichalisPapadakis opened this issue 2 months ago • 0 comments

Issue Type

  • [ ] 🐛 Bug / Problem
  • [ ] ✏️ Typo / Grammar
  • [ ] 📖 Outdated Content
  • [x] 🚀 Enhancement

Generated by Generative AI

No response

Distribution

No response

Description

In the tutorial for using Python Packages with ROS 2, it is mentioned how to install python modules via a virtual environment, but the info is not compete regarding what it is required to actually run the nodes in the packages that depend on these modules.

Personally, I have to manually update the PYTHONPATH environmental variable (or update the .bashrc) to include the modules of the virtual environment using

export PYTHONPATH=$PYTHONPATH:<path2venv>/lib/<venv-python-version>/site-packages

or update the python path in the launch file prior to launching the corresponding nodes.

If I am not using the virtual environments in a way that is not intended, I believe the detail should be mentioned.

Affected Pages/Sections

No response

Screenshots or Examples (if applicable)

No response

Suggested Fix

No response

Additional Context

No response

MichalisPapadakis avatar Oct 21 '25 16:10 MichalisPapadakis