Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

You need to check your $PYTHONPATH running echo $PYTHONPATH

This should show the path to your ROS distro, e.g. opt/ros/eloquent/lib/python3.6/site-packages, and the path to your environment packages .../path-to-your-env/lib/python3.6/site-packages.

If the env-package path is not present, add it using export PYTHONPATH='.../path-to-your-env/lib/python3.6/site-packages'

Run echo $PYTHONPATH again, check that your env-package path is there, and try to run your node ros2 run node...,... this should work.

To avoid adding the env-package path to $PYTHONPATH every single time, add export PYTHONPATH='.../path-to-your-env/lib/python3.6/site-packages' to your environment activate file.

Good luck!