This error may occur if your python path is not defined. But there may be another reason because of unwanted characters in your dataset. In my case, my dataset had one space in the column name. So when I tried to split my dataset with the help of a column name. I got a similar type of error.