[Solved]: UnboundLocalError: local variable 'a' referenced before assignment

Problem:

~/anaconda3/lib/python3.7/site-packages/numpy/lib/type_check.py in asscalar(***failed resolving arguments***)    487     488     """--> 489     return a.item()    490     491 #-----------------------------------------------------------------------------UnboundLocalError: local variable 'a' referenced before assignment

Solution:

Uninstalling Python 3.7 and installing Python 3.6 will fixed it.