Are you using Windows for this code?
If so, you should protect your code with
if __name__=='__main__':
    run()

Otherwise Windows might try to create processes recursively, yielding your error.
Let me know, if this is the case.