I am experiencing an issue with excessive logging output during the colcon build process for packages in the nav2. Despite not having verbose flags set, the build process generates a large amount of logging information, including detailed subprocess output and errors related to Python package identification.

colcon build --symlink-install --packages-select nav2_bringup --allow-overriding nav2_bringup
<string>:9: DeprecationWarning: 

  `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
  of the deprecation of `distutils` itself. It will be removed for
  Python >= 3.12. For older Python versions it will remain present.
  It is recommended to use `setuptools < 60.0` for those Python versions.
  For more details, see:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/rota_2024/.local/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 276, in run_setup
    raise RuntimeError(
RuntimeError: 'distutils.core.setup()' was never called -- perhaps 'setup.py' is not a Distutils setup script?
[1.991s] ERROR:colcon.colcon_core.package_identification:Exception in package identification extension 'python_setup_py' in 'src/gazebo_terrain/gazebo_terrain/lib/python3.10/site-packages/numpy/_typing': Command '['/usr/bin/python3', '-c', 'import sys;from contextlib import suppress;exec("with suppress(ImportError):    from setuptools.extern.packaging.specifiers    import SpecifierSet");exec("with suppress(ImportError):    from packaging.specifiers import SpecifierSet");from distutils.core import run_setup;dist = run_setup(    \'setup.py\', script_args=(\'--dry-run\',), stop_after=\'config\');skip_keys = (\'cmdclass\', \'distclass\', \'ext_modules\', \'metadata\');data = {    key: value for key, value in dist.__dict__.items()     if (        not key.startswith(\'_\') and         not callable(value) and         key not in skip_keys and         key not in dist.display_option_names    )};data[\'metadata\'] = {    k: v for k, v in dist.metadata.__dict__.items()     if k not in (\'license_files\', \'provides_extras\')};sys.stdout.buffer.write(repr(data).encode(\'utf-8\'))']' returned non-zero exit status 1.
etc etc etc ....

Finished <<< nav2_bringup [0.78s]

Summary: 1 package finished [8.14s]
  1 package had stderr output: nav2_bringup

The complete log output is too huge and can be checked in this Pastebin link Steps Tried:

  • Checked and set RCUTILS_LOGGING_SEVERITY to WARN to reduce ROS log levels.
  • Used colcon build --event-handlers console_cohesion+ to limit output to warnings and errors.
  • Reviewed colcon.meta files and other configuration files.
  • Attempted building individual components to isolate the issue.
  • Updated the environment and performed a clean build.
  • Upgraded Numpy and other pip packages

Despite these efforts, the excessive logging persists, making it challenging to track actual issues or relevant build output.

Desired Solution:

Having again the default output messages on console when building a ros2 package.

I don't remember which installation triggered this behavior of subprocess log outputs. I am not sure how to debug this debugger haha. Not sure, If it was a pip3 package installation or what has generated this behavior. My python3 modules installed can be checked in this Python3 Modules Pastebin List link.

Any assistance to help me clean these embarrassing log outputs from my console while building my ros2 packages is very welcome!


1 Answer 1


To ignore the deprecation warning, you could modify the PYTHONWARNINGS environment variable with PYTHONWARNINGS=ignore:::setuptools.command.install. A more comprehensive discussion can be found on this colcon issues thread.

  • $\begingroup$ Thanks Isak I have issued on terminal "export PYTHONWARNINGS=ignore:::setuptools.command.install " Unfortunately it did not work. The issue remains... $\endgroup$ Commented Apr 30 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.