Set value through variable
This is Python question in fact. First line does not get influence but gets the value of it.
You should get
c = bpy.context.object.pose.bones[&quot;Forearm.L&quot;].constraints[&quot;IK&quot;] 

then
c.influence = 1

_ lemon