I've seen this before, and it was because the Python environment variables weren't set correctly, or Python wasn't installed on the machine. It can also be because there are syntax errors in the code, but I know that's not the case.
Did you install Python with your ArcGIS Desktop install?
If you open the Python command line, can you import arcpy successfully?