tf2_ros ImportError:动态模块未定义模块导出函数(PyInit__tf2)

问题描述 投票:0回答:1

我无法在 python 代码中使用 tf2_ros 库。我正在使用 ros Melodic。

    import tf2_ros
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
    from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)

我尝试使用 python 的 tf2 库,但出现导入错误。只是我需要导入 tf2 库,并且我需要将此库与 python3 和 ros melodic 一起使用。

python-3.x ros importerror tf2-ros
1个回答
0
投票

你安装了tf2_ros库吗?如果没有,则在 Ubunutu 上使用以下命令安装

 install python-tf2-ros
© www.soinside.com 2019 - 2024. All rights reserved.