【python】local variable 'UserAgent' referenced before assignment

NoSuchKey