You get this error when you perform a multiple assignment to None
(which is of NoneType
). For instance:
X_train, y_train, X_test, y_test = None
TypeError: cannot unpack non-iterable NoneType object
So if you get this, the error is most likely that the right-hand part of the assignment is not what you expected (it’s nothing).