python ValueError: need more than XX values to unpack

this error seems you did not return the same number of results

for example:


def fun():
return 1
a,b = fun()


this will throw Exception : ValueError: need more than 2 values to unpack
change code:


def fun():
return 1,2
a,b = fun()


then ok!