The pdb module should contain a function called set_trace, however, when I run the code import pdb; pdb.set_trace() I get an error message saying module 'pdb' has no attribute 'set_trace'. Why is this error happening, even though my code is correct?
Here the code.py file I am executing to get this error:
print("Hello, World!")
import pdb
pdb.set_trace()
print("Goodbye, World!")
And here is the complete output of my program:
Hello, World!
Hello, World!
Traceback (most recent call last):
File "code.py", line 3, in
import pdb
File "/usr/lib/python3.6/pdb.py", line 76, in
import code
File "/tmp/code.py", line 4, in
pdb.set_trace()