I am using the pySerial library to have a Python script log data from an Arduino. I am trying to handle the SerialException when the script cannot connect to the port you provided, and Eclipse says "Undefined variable: SerialException". Is there something I forgot to import? Code: try: ser = serial.Serial(port, 9600) connected = 1 except SerialException: print "No connection to the device could be established" Continue reading...