Recently I installed the offline simulator from Universal Robots, and the install.sh turned out to remove my entire ROS install. Fine. I re-installed it following the official guide, and now rqt_graph does not work:
usr@legion:~/Documents/catkin_ws$ rqt_graph Traceback (most recent call last): File "/opt/ros/melodic/bin/rqt_graph", line 5, in <module> from rqt_gui.main import Main File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_gui/main.py", line 41, in <module> import rospy File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module> from .client import spin, myargv, init_node, File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/client.py", line 60, in <module> import rospy.impl.init File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/init.py", line 58, in <module> from rosgraph.rosenv import DEFAULT_MASTER_PORT # default port for master's to bind to ImportError: cannot import name DEFAULT_MASTER_PORT
(roscore is running in another terminal) I tried sudo apt install ros-melodic-rqt and sudo apt-get install python-rosgraph, but the error persists.
I dug and found out that this specific variable had been added to that file in the melodic distribution, so there may be a version conflict but I don’t know how to check that.
How to proceed?
Advertisement
Answer
I finally did sudo apt-get update and sudo apt-get upgrade and some ros packages have been updated, it works now. This may be useful to some 🙂