diff --git a/rosbag2_transport/package.xml b/rosbag2_transport/package.xml index 039dc587e..1fc5258a4 100644 --- a/rosbag2_transport/package.xml +++ b/rosbag2_transport/package.xml @@ -15,6 +15,7 @@ rosbag2_compression rosbag2_cpp rmw + rpyutils shared_queues_vendor yaml_cpp_vendor diff --git a/rosbag2_transport/rosbag2_transport/__init__.py b/rosbag2_transport/rosbag2_transport/__init__.py index f8087f749..fd206f59a 100644 --- a/rosbag2_transport/rosbag2_transport/__init__.py +++ b/rosbag2_transport/rosbag2_transport/__init__.py @@ -15,10 +15,16 @@ import importlib import os +from rpyutils import add_dll_directories_from_env + def _import(name): try: - return importlib.import_module(name, package='rosbag2_transport') + # Since Python 3.8, on Windows we should ensure DLL directories are explicitly added + # to the search path. + # See https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew + with add_dll_directories_from_env('PATH'): + return importlib.import_module(name, package='rosbag2_transport') except ImportError as e: if e.path is not None and os.path.isfile(e.path): e.msg += \