ros2 / ros2_documentation

ROS 2 docs repository
https://docs.ros.org/en/rolling
Creative Commons Attribution 4.0 International
519 stars 1.04k forks source link

ros2 demos complaining about "ModuleNotFoundError: ... packaging" on Win10 with RTI DDS #1680

Open Becker-Asano opened 3 years ago

Becker-Asano commented 3 years ago

I followed this guide for installing ROS2 under Windows 10:

https://docs.ros.org/en/ros2_documentation/galactic/Installation/Windows-Install-Binary.html

First, after executing "local_setup.ps1" (in Windows PowerShell) under "Environment Setup" I got the following error:

PS C:\dev> C:\dev\ros2-galactic\local_setup.ps1
"[rti_connext_dds_cmake_module][warning] RTI Connext DDS environment script not found (\resource\scripts\rtisetenv_x64Wi
n64VS2017.bat). RTI Connext DDS will not be available at runtime, unless you already configured PATH manually."

This I could solve by manually installing RTI DDS for Windows as described here: https://docs.ros.org/en/foxy/Installation/DDS-Implementations.html#windows-binary-install

I executed "local_setup.ps1" again and got no (!) output. Seemed fine to me..

However, I get the following missing module message:

PS C:\dev> ros2 run demo_nodes_cpp talker
Traceback (most recent call last):
  File "C:\dev\ros2_galactic\Scripts\ros2-script.py", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.13.1', 'console_scripts', 'ros2')())
  File "C:\dev\ros2_galactic\Scripts\ros2-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "c:\python38\lib\importlib\metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "c:\python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\dev\ros2_galactic\Lib\site-packages\ros2cli\cli.py", line 19, in <module>
    from ros2cli.command import add_subparsers_on_demand
  File "C:\dev\ros2_galactic\Lib\site-packages\ros2cli\command\__init__.py", line 23, in <module>
    from ros2cli.plugin_system import instantiate_extensions
  File "C:\dev\ros2_galactic\Lib\site-packages\ros2cli\plugin_system.py", line 19, in <module>
    from packaging.version import Version
ModuleNotFoundError: No module named 'packaging'

Anyone having an idea what I might have missed?

smvaraprasad commented 1 year ago

Just making sure that, I was installing the module "packaging" in the right version of python helped me get rid of this error.