I tried to animate simple bones with python, keyframes are inserted in timeline but nothing happens, Partially this question is copy-paste of that one (sorry) but I didn't find answer there
Controlling armature through python
import bpy
import math
import mathutils
from mathutils import Euler
rig = bpy.data.objects['Armature']
bone = rig.pose.bones['Bone.00']
print("temp", rig)
rot = math.radians(5)
bone.rotation_euler = Euler((rot, rot, rot))
bone.keyframe_insert('rotation_euler', frame=1)
rot2 = math.radians(100)
bone.rotation_euler = Euler((rot2, rot2,rot2 ))
bone.keyframe_insert('rotation_euler', frame =50)
UPDATE: After running few times and removing previous keyframe animation is still cached somewhere how to clear it ?
bone.rotation_quaternion
$\endgroup$