Import pymysql is giving error as AttributeError: module 'pymysql.constants.ER' has no attribute 'CONSTRAINT_FAILED'

Using pymysql in Python 3.5  
Operating System is Windows 10
I usually think about attributes as nouns that belong to an object.An attribute in Python means some property that is associated with a particular type of object. In other words, the attributes of a given object are the data and abilities that each object type inherently possesses. An object in Python is a simply an enclosed collection of these abilities and data, and is said to be of a specific type.
Attribute errors in Python are generally raised when the Python interpreter cannot find a specified data or method attribute on an object that allows for attribute references, it will raise an "AttributeError" exception. When you get an attribute error in Python, it means you tried to access the attribute value of, or assign an attribute value to, a Python object or class instance in which that attribute simply does not exist.
AttributeError: module 'pymysql.constants.ER' has no attribute 'CONSTRAINT_FAILED' in pymysql Python