How to use a Jupyter Notebook with Colcon?
I've got a problem that I suspect is easy, but I absolutely can't figure out---any advice is much appreciated.
Here's the situation: I have a standard ROS2/Colcon Python package (ie. basically fresh out of ros2 pkg create
, built with ament_python
). This package contains various Python files used in production.
In addition, for prototyping purposes, I'd like to add a Jupyter notebook. I need the notebook to be able to import other files in the package and its dependencies. I don't care if the notebook is included in the build output or not. I don't mind running a build once (or if dependencies change), but I'd really like to avoid re-building every time I change the notebook or an imported file.
I've tried various approaches involving modifications to sys.path
inside the notebook, but I haven't been able to get anything to work. I think the --symlink-install
flag to colcon build
might also be helpful, but I'm not sure exactly how.