The likely reason you ran into this problem is because the code you used was written for Python 3.x and you ran it under Python 2.x.
I know that someone already partially said this, but I thought it would be useful to make it clearer for people new to Python who might not understand why the argument “utf-8” was used as the person asking the question that they didn’t know what the arguments were for.
Anyone who comes here can find this helpful in understanding why there was a "utf-8" argument.
kmcguire
source share