It might be that the parser
module you're importing is not the one you want.
Try inserting a:
print parser.__file__
right after the imports, or try naming your parser module differently.
Also, if working with Python 2.7 its good to enable absolute_imports
from the __future__
module.