question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Launching ipdb (or pdb) in steps

See original GitHub issue

Hello,

Is it possible to use ipdb (or pdb) inside steps? On my code, it hangs without showing anything.

I have something like:

class MyTrain(FlowSpec):

    @step
    def start(self):
        print("Start ipdb")
        __import__("pdb").set_trace()

        self.next(self.load_dataset)

And the final output is:

$ python train.py run
...
2020-01-08 16:45:59.297 [1578512759283042/start/1 (pid 22301)] Task is starting.
2020-01-08 16:46:00.773 [1578512759283042/start/1 (pid 22301)] > /home/user521/metaflow-pytorch-example/train.py(97)start()

Thanks

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
yarivcommented, Mar 4, 2020

I use vim and debug python from the command line using ipdb so these instructions won’t work for me, unfortunately. If I could submit a feature request it would be to make it so that --max-workers=1 prevents forking child processes and serializes the execution in the main process.

3reactions
ifokeevcommented, Mar 23, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Better Python Debugging With IPDB - Hasil Sharma
Searching for a better approach to debug code, there is always something better available out there, I came across pdb and ipdb.
Read more >
Python Debugging With Pdb
In this hands-on tutorial, you'll learn the basics of using pdb, Python's interactive source code debugger. Pdb is a great tool for tracking...
Read more >
Step-by-step debugging with IPython - Stack Overflow
From what I have read, there are two ways to debug code in Python: With a traditional debugger such as pdb or ipdb...
Read more >
Python Debug Cheatsheet - Peter Xie - Medium
ipdb is an enhanced version of pdb (built-in). It supports all pdb commands and is simply easier to use like tab for auto-complete....
Read more >
Advanced Python Debugging with pdb | Codementor
Dropping into the debugger from Python code using pdb.set_trace. Another technique that I used early on, after starting to use pdb , was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found