File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2323from .comm .comm import BaseComm
2424from .comm .manager import CommManager
2525from .compiler import XCachingCompiler
26- from .debugger import Debugger , _is_debugpy_available
2726from .eventloops import _use_appnope
2827from .iostream import OutStream
2928from .kernelbase import Kernel as KernelBase
@@ -72,7 +71,9 @@ class IPythonKernel(KernelBase):
7271 shell = Instance ("IPython.core.interactiveshell.InteractiveShellABC" , allow_none = True )
7372 shell_class = Type (ZMQInteractiveShell )
7473
75- debugger_class = Type (Debugger )
74+ # use fully-qualified name to ensure lazy import and prevent the issue from
75+ # https://github.com/ipython/ipykernel/issues/1198
76+ debugger_class = Type ("ipykernel.debugger.Debugger" )
7677
7778 use_experimental_completions = Bool (
7879 True ,
@@ -113,6 +114,8 @@ def __init__(self, **kwargs):
113114
114115 self .executing_blocking_code_in_main_shell = False
115116
117+ from .debugger import _is_debugpy_available
118+
116119 # Initialize the Debugger
117120 if _is_debugpy_available :
118121 self .debugger = self .debugger_class (
You can’t perform that action at this time.
0 commit comments