That’s indeed a bad first experience 
Could you run the code in a terminal and try to get the stack trace via:
$ gdb --args python my_script.py
...
Reading symbols from python...done.
(gdb) run
...
(gdb) backtrace
...