ImportError: No module named spdb

Issue #5 resolved
Shashank Sharma
created an issue

I am getting the error about "ImportError: No module named spdb"

Here is my code snippet:

import sys

def run():
    sys.stderr.write("start debug\n")
    import spdb ; spdb.start()
    x = os.path.join("foo", "bar")
    z = 5

run()

I just hit Ctrl+B in my Sublime Text 3 and this is the error that I get in the console. Any pointers..

Comments (2)

  1. Kay-Uwe (Kiwi) Lorenz repo owner

    Hi Shashank,

    Plugin debugger is a special purpose python debugger for debugging sublime plugins. For python debugging use normal

       import rpdb2 ; rpdb2.start_embedded_debugger('foo')
    

    and run winpdb. Select File -> Attach and type in your password 'foo'.

    For using spdb, you have to create a sublime plugin and run it either from sublime console or with an bound keystroke or from command palette. E.g. for your code snippet

    import sublime, sublime_plugin, os, sys
    
    class MyCommand(sublime_plugin.WindowCommand):
    
        def run(self):
            sys.stderr.write("start debug\n")
            import spdb ; spdb.start()
            x = os.path.join("foo", "bar")
            z = 5
    

    Then go to sublime console and there run

    window.run_command("my_command", {})
    
  2. Log in to comment