Ros2 import regular python modules from where
Ubuntu 20.04 ros2 foxy This may be a dumb question but I have not yet run into it so I feel the need to ask. If I am writing a python node and I want some modules from pip (or conda I suppose) such as pyserial, to what do I install the module in order to be able to use it in a ros2 node? If I wanted to use pyserial in a regular python script for a project, I would go to my venv that I use for misc projects and pip install pyserial from that environment, then use it. Am I supposed to run
python3 -m pip install -U pyserial
just for my system python? Because I've always made some sort of venv for my projects because gumming up the system with random modules usually results in me breaking something or causing some sort of package conflict. I know I can run limited ros functions from a venv (done it through an anaconda env once before to be able to run tensorflow2 in python3 in ros melodic) but I cant see that being something that is regular practice. For C++ I can just put the header/source files in a library type folder inside the ros package so that isn't an issue.