I have difficulties to understand the legend handling. The more, the basic example from the official matplotlib legend guide
import matplotlib.pyplot as plt
I had the same error some while back, but the fixes suggested above didn't work for me. I updated my version of matplotlib as well, but this didn't help.
What did work was removing the handles argument and which plots to label altogether in the legend() method; like this:
plot1 = plt.plot([1,2,3], 'b', label = 'first plot')
plot2 = plt.plot([3,2,1], 'r', label = 'second plot')
plt.legend()
plt.show()
Which rendered nicely to this: