ImportError: No module named gobject

ImportError: No module named gobject

我安装了 ros1 并创建了一个 catkin 工作区。在 src 文件夹中,我克隆了一个 ros 包 "executive_smach_visualization"。但是,当我尝试使用以下命令 运行 它时,出现错误。

rosrun smach_viewer smach_viewer.py

回溯:

wxversion 2.8 is not installed, installed versions are ['3.0-gtk3']
Traceback (most recent call last):
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/scripts/smach_viewer.py", line 77, in <module>
from smach_viewer import xdot
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/__init__.py", line 1, in <module>
import wxxdot
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/wxxdot.py", line 22, in <module>
from xdot import *
File "/home/developer/catkin_ws/src/executive_smach_visualization/smach_viewer/src/smach_viewer/xdot/xdot.py", line 34, in <module>
import gobject
ImportError: No module named gobject

我已经尝试过以下操作:

1) 使用 pip 安装 goobject

2) 将 gobject 从 git 克隆到 catkin_ws、catkin_make 和 setup.bash

的 src 文件夹

可能是什么问题?如果我遗漏任何重要信息,请告诉我。提前致谢。

如果ros版本不同,python等等,就会出现这个问题

好像包有点过时了。

编辑:

下载包后和构建工作环境时,使用:

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so

Please refer to 1.5 section (User configuration) of this guide