importError: dynamic module does not define module export function (PyInit__tf2)
在手眼标定的launch文件写完之后,运行发现出现的第一个问题就是这个问题。
Traceback (most recent call last): File "/home/bjh/catkin_ws/src/learning_tf2/nodes/static_turtle_tf2_broadcaster.py", line 8, inimport tf File "/home/bjh/catkin_ws/devel/lib/python2.7/dist-packages/tf/__init__.py", line 35, in exec(__fh.read()) File " ", line 30, in File "/home/bjh/catkin_ws/devel/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 35, in exec(__fh.read()) File " ", line 38, in File "/home/bjh/catkin_ws/devel/lib/python2.7/dist-packages/tf2_py/__init__.py", line 35, in exec(__fh.read()) File " ", line 38, in importError: dynamic module does not define module export function (PyInit__tf2)
查了很多资料发现,这个问题是当初安装anaconda时python冲突导致的,和下面出现的问题一样:
Could not import "pyqt" bindings of qt_gui_cpp library - so C++ plugins will not be available: Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/qt_gui_cpp/cpp_binding_helper.py", line 43, infrom . import libqt_gui_cpp_sip importError: dynamic module does not define module export function (PyInit_libqt_gui_cpp_sip)
这些问题都是因为anaconda和ubuntu18.04自带的python版本不同所导致的,因此,解决方法为:
gedit ~/.bashrc
在 unset __conda_setup后面加上
conda deactivate
2.AttributeError: 'module' object has no attribute'CALIB_HAND_EYE_TSAI'
出现这个问题的原因在于python的opencv版本过低,低版本的opencv中没有手眼标定的函数,因此需要更新opencv版本即可。
pip2 install opencv-python==4.2.0.32
https://github.com/IFL-CAMP/easy_handeye/issues/78
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)