built-in functions and exceptions ioerror failed / operation the value is an ioerror instance with the attributes errnostrerrorand filename errno is an integer error numberstrerror is string error messageand filename is an optional filename subclass of environmenterror importerror raised when an import statement can' find module or when from can' find name in module indentationerror indentation error subclass of syntaxerror indexerror sequence subscript out of range subclass of lookuperror keyerror key not found in mapping subclass of lookuperror keyboardinterrupt raised when the user hits the interrupt key (usually ctrl+cmemoryerror recoverable out-of-memory error nameerror name not found in local or global namespaces notimplementederror unimplemented feature can be raised by base classes that require derived classes to implement certain methods subclass of runtimeerror oserror operating system error primarily raised by functions in the os module the value is the same as for ioerror subclass of environmenterror overflowerror result of an integer value being too large to be represented this exception usually only arises if large integer values are passed to objects that internally rely upon fixedprecision machine integers in their implementation for examplethis error can arise with range or xrange objects if you specify starting or ending values that exceed bits in size subclass of arithmeticerror referenceerror result of accessing weak reference after the underlying object has been destroyed see the weakref module runtimeerror generic error not covered by any of the other categories lib fl ff