First time here? Check out the FAQ!
answered 2018-01-21 10:15:42 -0600
"with cv.KNearest() it's ok" -- this means, you are using outdated opencv2.4.x, and cannot run opencv3.x tutorial code.
you might want to try, if the samples from the 2.4 branch work for you.