Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

debugging - Visual Studio Code Python Timeout waiting for debugger connection

I'm running the visual studio code tutorial with Python and am unable to connect to the debugger. Google / SO are coming up empty when I search. Usually I use Anaconda with Jupyter, so I'm connecting Visual Studio Code to the python in my activated 3.6 virtual environment. I tried pip installing ptvsd in my virtual environment, but that did not make a difference in what I am seeing.

I would welcome any suggestions. Screenshots included below. launch.json in the bottom screenshot

enter image description here enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Open the launch.json file and add the following configuration:

{
     "name": "Python: Debug Console",
     "type": "python",
     "request": "launch",
     "program": "${file}",
     "console": "internalConsole"
}

When you specify none internalConsole for the console, it will run the debugger in the debugger console instead of running in the internal or external terminal.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...