今天用ros,在運作roscore時出現了如下錯誤
Traceback (most recent call last):
File “/opt/ros/kinetic/bin/roscore”, line 36, in
from rosmaster.master_api import NUM_WORKERS
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/init.py”, line 35, in
from .main import rosmaster_main
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/main.py”, line 43, in
import rosmaster.master
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master.py”, line 47, in
import rosmaster.master_api
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py”, line 72, in
from rosmaster.util import xmlrpcapi
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py”, line 48, in
from defusedxml.xmlrpc import monkey_patch
ImportError: No module named ‘defusedxml’
發現是我把ubuntu中的python版本改成了python3.5,改回python2.7就好。
具體怎麼更改python版本看一下我之前的部落格 ^ _ ^