roscore : 出现:Traceback (most recent call last)

问题 roscore 后出现:

Traceback (most recent call last):
  File "/opt/ros/kinetic/bin/roscore", line 36, in <module>
    from rosmaster.master_api import NUM_WORKERS
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/__init__.py", line 35, in <module>
    from .main import rosmaster_main
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/main.py", line 43, in <module>
    import rosmaster.master
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master.py", line 47, in <module>
    import rosmaster.master_api
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 72, in <module>
    from rosmaster.util import xmlrpcapi
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 48, in <module>
    from defusedxml.xmlrpc import monkey_patch
ModuleNotFoundError: No module named 'defusedxml'

原因:

  • python链接到了3.6

解决办法:

sudo rm -rf /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python

你可能感兴趣的:(ubuntu,python,ROS问题总结,linux,ubuntu)