Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
Traceback (most recent call last):
File "/home/kwinklink/catkin_ws/src/turtlesim_cleaner1/src/turtlesim_cleaner1/rotate.py", line 2, in <module>
import rospy
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/__init__.py", line 47, in <module>
from std_msgs.msg import Header
File "/opt/ros/noetic/lib/python3/dist-packages/std_msgs/msg/__init__.py", line 1, in <module>
from ._Bool import *
File "/opt/ros/noetic/lib/python3/dist-packages/std_msgs/msg/_Bool.py", line 5, in <module>
import genpy
File "/opt/ros/noetic/lib/python3/dist-packages/genpy/__init__.py", line 34, in <module>
from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
File "/opt/ros/noetic/lib/python3/dist-packages/genpy/message.py", line 47, in <module>
import yaml
File "/usr/lib/python3/dist-packages/yaml/__init__.py", line 399
class YAMLObject(metaclass=YAMLObjectMetaclass):
SyntaxError: invalid syntax
Here i have a picture of the error:
enter image description here
I will appreciate any answers please help i have been workon on this error for a werry long time.
In my rotate.py i onli have
#!/usr/bin/env python import rospy
–
–
–
I found the solution!
Turns out all I had to do was to change
#!/usr/bin/env python import rospy
To:
#!/usr/bin/env python3 import rospy
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.