admin管理员组文章数量:1558098
ImportError: dynamic module does not define module export function (PyInit__tf2)
亲测有用!
主要参考:
这里
sudo apt update
sudo apt install python3-catkin-pkg-modules python3-rospkg-modules python3-empy
mkdir -p ~/catkin_ws/src; cd ~/catkin_ws
catkin_make
source devel/setup.bash
wstool init
wstool set -y src/geometry2 --git https://github/ros/geometry2 -v 0.6.5
wstool up
rosdep install --from-paths src --ignore-src -y -r
catkin_make --cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.6m \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.6m.so
照着上面一字不差的运行完。
然后就会在目录~/catkin_ws/src/geometry2
文件夹下生成你需要的包tf2_ros
。后面就只需要把py文件中用到import tf2_ros
的地方换成新的路径。
下面是其中一种解决方法:
import sys
sys.path.append("/home/lh/catkin_ws/src")
from geometry2 import tf2_ros
最后一行会报红,但不影响,可以忽略。
本文标签: ModuledynamicImportErrordefinefunction
版权声明:本文标题:【已解决】ImportError: dynamic module does not define module export function (PyInit__tf2) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1727317493a1107984.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论