Maybe you have two different Pythons installed; one is found first in the path, the other has the association for .py files. I don't know why the second works differently, though...