What do you mean by “vanish”?
Does you kernel just die or do you get any error message?
If you are running your script in a Jupyter notebook, try to export it as a .py file and run it in a terminal.
Sometimes the IPython kernel just dies without throwing the error message.