Python- problem with "bpy.data.objects['anyobject'].select=True "
You need to set the object to be the active object as well as selected

The below code works for me, I just added a Cube at origin (0, 0, 0) selected it then run this script from the text editor (or you can run it from the console as well):

import bpy
C = bpy.context
scene = C.scene
bpy.ops.object.duplicate()
bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Cube'].select=True
scene.objects.active = bpy.data.objects['Cube']


This is what happens after running the script: