Which package do you mean torch?

You can check the getting started 2 section and choose conda instead of pip.

Now, I use from times to times gdb (trace back) for my C++ applications but not for python code…

You can do the exact same thing by running python. You do first gdb python then in gdb r you_script.py. Please post the stack trace here !