运行“ros2 主题列表”时无法加载入口点“列表”

运行“ros2 主题列表”时无法加载入口点“列表”

在 Ubuntu 20.04 上新安装 Ros 2 Foxy 后在终端运行时ros2 topic list显示以下错误。

/opt/ros/foxy/bin/ros2:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
Failed to load entry point 'list': 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/usr/bin/python3"
  * The NumPy version is: "1.23.5"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

Traceback (most recent call last):
  File "/opt/ros/foxy/bin/ros2", line 11, in <module>
    load_entry_point('ros2cli==0.9.13', 'console_scripts', 'ros2')()
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2cli/cli.py", line 39, in main
    add_subparsers_on_demand(
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2cli/command/__init__.py", line 250, in add_subparsers_on_demand
    extension.add_arguments(
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2topic/command/topic.py", line 29, in add_arguments
    add_subparsers_on_demand(
  File "/opt/ros/foxy/lib/python3.8/site-packages/ros2cli/command/__init__.py", line 237, in add_subparsers_on_demand
    extension = command_extensions[name]
KeyError: 'list'

有人能告诉我如何解决这个问题吗?Numpy 似乎在这里遇到了问题。

提前致谢。

相关内容