Thanks for your reply!
The point in your reply may be a case that caused the problem. But I found that I got the above error because I defined a metrics package that has same name with built-in package. Add from future import absolute_import can solve it.