when i run script python (import rospy) i have this error
Straight dump of the traceback:
Traceback (most recent call last):
File "haw.py", line 1, in <module>
import rospy
File "/usr/lib/python3/dist-packages/rospy/__init__.py", line 49, in <module>
from .client import spin, myargv, init_node, \
File "/usr/lib/python3/dist-packages/rospy/client.py", line 54, in <module>
import rospy.core
File "/usr/lib/python3/dist-packages/rospy/core.py", line 75, in <module>
from rosgraph_msgs.msg import Log
ImportError: cannot import name 'Log' from 'rosgraph_msgs.msg' (/opt/ros/foxy/lib/python3.8/site-packages/rosgraph_msgs/msg/__init__.py)
I'm confused:
rospy
is ROS 1, but you've tagged the question withros2
and the traceback mentions ROS Foxy .. (which is ROS 2).And
rospy
is not supposed to be in/usr/lib/python3
, but in/opt/ros
.Is this a mixed ROS 1 + ROS 2 install where the ROS 1 packages are actually UpstreamPackages?