The main cause that you are having this problem is the formatting of the u.data file. While inserting headers, the separation should be exactly the same as the format of separation between a row of data. For example, if space is used to separate a tuple then you should not use tabs.
You should modify your data file. In your u.data file add headers and separate them exactly with as many whitespaces as were used between the items of a row. I suggest using sublime text because notepad/notepad++ does not work sometimes.
Hope this answer helps.