There was a bug in ASE package.

When I tried to read a vasprun.xml file using like,

atoms= read('vasprun.xml', index=0, format='vasp-xml')

and the vasprun.xml contains some constraints for atoms, I got the following message,

Traceback (most recent call last):
  File "/Users/kobayashi/src/fitpot/", line 63, in <module>
    atoms= read('vasprun.xml',index=0,format='vasp-xml')
  File "/Users/kobayashi/src/ase/ase/io/", line 290, in read
    return next(_iread(filename, slice(index, None), format, **kwargs))
  File "/Users/kobayashi/src/ase/ase/io/", line 360, in _iread
    for dct in, *args, **kwargs):
  File "/Users/kobayashi/src/ase/ase/io/", line 451, in read_vasp_xml
    constraints.append(FixScaled(cell, i, flags))
UnboundLocalError: local variable 'cell' referenced before assignment

I fixed cell to cell_init on a line 451 in ase/io/ Then now it works fine ;)