Your srp function returned a NoneType object that you stored in the ans variable. Trying to call the summary() or any other function on this NoneType object will return an AttributeError. The srp function probably have a documentation detailing how to use it.
help(srp). This means that no answer packet were received