title: Failed to launch rospy file: SyntaxError: invalid syntax YAMLObject(metaclass=YAMLObjectMetaclass):
body: <p>So here is the full error:</p>
  <pre><code>$ rosrun turtlesim_cleaner1 rotate.py 
  
  Traceback (most recent call last):
    File &quot;/home/kwinklink/catkin_ws/src/turtlesim_cleaner1/src/turtlesim_cleaner1/rotate.py&quot;, line 2, in &lt;module&gt;
      import rospy
    File &quot;/opt/ros/noetic/lib/python3/dist-packages/rospy/__init__.py&quot;, line 47, in &lt;module&gt;
      from std_msgs.msg import Header
    File &quot;/opt/ros/noetic/lib/python3/dist-packages/std_msgs/msg/__init__.py&quot;, line 1, in &lt;module&gt;
      from ._Bool import *
    File &quot;/opt/ros/noetic/lib/python3/dist-packages/std_msgs/msg/_Bool.py&quot;, line 5, in &lt;module&gt;
      import genpy
    File &quot;/opt/ros/noetic/lib/python3/dist-packages/genpy/__init__.py&quot;, line 34, in &lt;module&gt;
      from . message import Message, SerializationError, DeserializationError, MessageException, struct_I
    File &quot;/opt/ros/noetic/lib/python3/dist-packages/genpy/message.py&quot;, line 47, in &lt;module&gt;
      import yaml
    File &quot;/usr/lib/python3/dist-packages/yaml/__init__.py&quot;, line 399
      class YAMLObject(metaclass=YAMLObjectMetaclass):
                                ^
  SyntaxError: invalid syntax
  </code></pre>
  <p>Here i have a picture of the error:
  <a href="https://i.stack.imgur.com/u8L1c.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  <p>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<code>#!/usr/bin/env python import rospy</code></p>