Closed F8F-Bearcat closed 6 years ago
OK, so I added settings.json in .vscode my python.pythonPath in settings.json in .vscode looks like this: "python.pythonPath": "C:\PyAna2\envs\pandas36\python.exe",
No change in the timeout behavior - still does not connect and times out
Also, this is Windows 10 professional release 10.0.17134
Dug into conda location.
I have conda.bat located in C:\PyAna2\Library\bin
I also have C:\PyAna2\Library\bin on my path
C:\PyAna2\envs\pandas36\python.exe
"python.pythonPath": "C:\\PyAna2\\envs\\pandas36\\python.exe",
Note, this is a JSON file hence back slashes need to be encoded.
Instead of manually editing the settings.json
, please could you select a python interpreter from the UI.
Either use the command Python: Select Interpreter
or use click on the status bar item (either Please Select Interpreter
or <Some Python Interpreter Information>
Finally, please try install the latest development version of the extension from here and give it a go. https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build
Hi Don, thanks for getting back to me with these suggestions.
Confirmed C:\PyAna2\envs\pandas36\python.exe exists both by file manager and activating the pandas36 environment in conda and running a notebook from that activated environment.
When I loaded settings.json, the double backslashes had already been changed / fixed.
"python.pythonPath": "C:\PyAna2\envs\pandas36\python.exe",
Tried debugger connection - still a timeout and no connection
Finally, I tried the insiders VSIX file, it did not load.
Got this error message:
/C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2407 Sorry, something went wrong activating IntelliCode support for Python. Please check the "VS IntelliCode" output window for details.
I used View:Toggle Output a couple of times but am not seeing anything in the output window that is helpful. I'm cycling through Problems / Output / Debug Console / Terminal "tabs" and also all combinations of the pulldown on the right.
Tried to connect debugger again, no connection.
How would I uninstall the VSIX file?
Please send a screen shot of the contents in settings.json To install the vsix, just uninstall the python extension and quit vscode.
I was testing for issue #2698 and faced similar issue with in-development build vsix. F5 started the debugger for Python-Flask debug config, it gets hung. Similarly with Python-Current File debug config, if any of the module imports fails, exception is not shown on the terminal, but the debugger get hung.
I pressed Ctrl+C to break, and got the below stack
Traceback (most recent call last): File "c:\Users\abcd.vscode\extensions\ms-python.python-2018.8.1-beta\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd_pydevd_bundle\pydevd_frame.py", line 649, in trace_dispatch self.do_wait_suspend(thread, frame, event, arg) File "c:\Users\abcd.vscode\extensions\ms-python.python-2018.8.1-beta\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd_pydevd_bundle\pydevd_frame.py", line 134, in do_wait_suspend self._args[0].do_wait_suspend(*args, **kwargs) File "c:\Users\abcd.vscode\extensions\ms-python.python-2018.8.1-beta\pythonFiles\experimental\ptvsd\ptvsd_vendored\pydevd\pydevd.py", line 827, in do_wait_suspend time.sleep(0.01) KeyboardInterrupt
VS Code version 1.27.2 Python extension: latest development build
@MandarJKulkarni
, if any of the module imports fails
Please elaborate on this. How do you know about this failure,
for Mandar: my issue occurs with or without the in-development vsix build
my user settings.json:
my workspace settings.json
@F8F-Bearcat
Next:
Run Python File in Terminal
, let me know what you get in there.Finally, I tried the insiders VSIX file, it did not load.
Please disable Intelli-code for now (or just uninstall it). and try again.
I am unable to debug a simple program as the debugger doesn't connect. I set a breakpoint in this program, and when I activate the debugger with the green "go" I get the popup timeout message.
Run Python in Terminal yields:
Disabled the Intelli-code for now. Re-ran everything is the same. I am noticing a little orange alert on the gearbox that says there is some issue with launch.json. Looks like this is present in all of the screenshots today. I had set this up before, and somehow I must have deleted it.
After I disabled Intelli-code, I shut VScode down and restarted. It gave me a new window. When I opened a folder in my VScode root directory, I got my old files back. Interestingly, a comma had been dropped out of my launch.json file, I added the comma, saved, and re-ran the program successfully, went to activate the debugger (debugger gear now clear), same behavior: Timeout waiting for debugger connections.
Likely unrelated, but also see this terminal output, which looks strange and I have not seen before. I am much more interested in the lack of debugger connection.....
@MandarJKulkarni @F8F-Bearcat Please could you both try the following
Item 1
settings.json
and add the following setting
"python.terminal.actiavteEnvironment": false
Item 2: If previous step doesn't work
powershell
to command prompt
Open your command palette and select Terminal: Select Default Shell
.
Select Command Prompt
Please do send screenshots, that helps a lot. @F8F-Bearcat Thanks for the great screenshots.
For Item 1: added the terminal activate parameter as false, tried debugging - same behavior, no connection
For item 2: changing to the command prompt did do something, bit looks like it hit an error on the command line before the debugger tried to connect. I don't know where this command line string comes from to edit the &&. I'll also try restarting VScode.
@DonJayamanne , Sorry, none of the 2 items worked for me.
About the "Please elaborate on this. How do you know about this failure,": It was not a system module, but the module written by me which had some issue. I verified the import failure by trying to import that module from Python prompt.
OK, reran after restarting VScode. This got past the command line issue. Debugger still timed out. Note that I am making the changes to the settings.json file for User Settings, not Workplace Settings, assuming that User overrides Workplace.
Should I remove the activateEnvironment flag as it did not change the behavior? In the spirit of just changing one thing at a time.
Please could you try this once again however, this time go into your .vscode/launch.json
file and add a setting for timeout
with a value of around 10000
(10 seconds) as follows:
"timeout": 10000
},
Please ensure this setting is added into the right launch configuration item.
I entered the timeout parameter. Continues to not connect. It appears to be a property that is not allowed. It had a green squiggle under timeout, and when I hover over it I get "Property timeout is not allowed"
when I hover over it I get "Property timeout is not allowed"
Yes, that's fine.
Using that parameter I still had the debugger timeout issue.
I am getting the same timeout. It seems related to Anaconda. I'm using the Visual Studio Anaconda install C:\Program Files (x86)\Microsoft Visual Studio\Shared\Anaconda3_64, Python 3.6.
I can debug against standard Python 3, and virtual environments built off them. I tried things from above but cannot debug if targeting Anaconda.
I tried switching to Visual Studio 2017 15.8.5 and the debugger connects but after a couple seconds I get an error saying "The debug adapter exited unexpectedly."
I was able to get debugging working in VS Enterprise 2017 15.8.5 by enabling legacy debugging Not sure if that's possible in VS Code. Sorry if this is irrelevant, but from what I understand the underlying debugger is the same in 15.8 and the current VS Code with python extension.
Thanks for narrowing down the issue to Anaconda, that helps. Please could you try the following:
.vscode/launch.json
and add the setting "logToFile": true
Extensions: Open Extensions Folder
ms-python.python-2018-**
debug.log
, please upload that file hereWelcome 2Dews! FYI, in my case I had a existing Anaconda installation, and added VSCode later. DonJ - thanks for the suggested steps! Attached is the debug.log file
@F8F-Bearcat
Please could you test this with another distro of Python, other than Anaconda?
Please could you try installing python from here (https://www.python.org/downloads/) and trying this out (only if possible).
Downloaded Python 3.6.5 64 bit, installed off the system path, configured to point to that location, and now am able to connect to the debugger.
So that works.
I've had the same timeout issue for about a month now. I tried cloning my conda enviroment and I could debug in the cloned environment, but not in the original. Now, a couple of weeks later, the copied environment also times out when debugging.
I also think the issue is not exclusive to vscode. I've tried using PyCharm, and there the debugger stops silently. Likely also timing out, but without the error message.
@F8F-Bearcat @2Dews @ColombianViking Please could you debug this once again with a minor change:
.vscode/launch.json
in your workspacePTSVD_DEBUG
and ensure not to use a Terminal
"console": "none",
"env": {
"PTVSD_DEBUG": "1"
}
Debug Console
(if not already opened), copy all of the content and past it in here on GitHub.
Debug console
Here's a screenshot of the file being debugged, the launch.json
and the output window.
This did not work for me. The debugger did not connect, and also did not timeout. I tried this with and without version 1.0.4 of the Visual Studio Intellisense extension enabled. Is there an updated version of this extension.
This did not work for me. The debugger did not connect, and also did not timeout.
What happened? If it didn't work and didn't time out then what happened?
Hi Don, it sat there with the little yellow line going across over and over like it was hung. After a while, I just closed VScode. There was never any debug console output
@F8F-Bearcat @ColombianViking @2Dews
I'd like to get to the bottom of this.
I'm in Redmond, USA (Pacific Daylight Time)
Would appreciate it if someone can get onto Skype with me to sort this out. Or we could use VS Live Share
Hi Don, appreciate your determination to chase this down. I'm also on Pacific time and would be able to work with you on this, for awhile anyway, but will need to schedule it - can't do it in the next couple of days. What's the best way to schedule a time? to be in contact?
My email address is don.jayamanne<at><company I work for>.com
@HughGrovesArup
Please could you try this once again however, this time go into your .vscode/launch.json file and add a setting for timeout with a value of around 10000 (10 seconds) as follows:
"timeout": 10000
},
Please ensure this setting is added into the right launch configuration item.
Did this
Tried to start debugging with F5, still get this
Hi, I have the exact same issue, debugging is not working. But by right clicking my python file in the explorer and then hitting "Run python file in terminal", is working. It's obviously not debugging but certainly python works. I've installed python via Anaconda as well.
I started having the same problem as everybody else as of today. Had no changes in my environment, was working until yesterday. The only change I can think of was installing the latest Windows 10 update this morning
Here's my console log if that helps:
17:17:59, 2018-10-7 Started @ Sun Oct 07 2018 17:17:59 GMT+0000 (UTC) From Client: Content-Length: 148
{"type":"request","seq":1,"command":"initialize","arguments":{"adapterID":"python","linesStartAt1":true,"columnsStartAt1":true,"pathFormat":"path"}} To Client: Content-Length: 687
{"seq":1,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsExceptionInfoRequest":true,"supportsConfigurationDoneRequest":true,"supportsConditionalBreakpoints":true,"supportsSetVariable":true,"supportsExceptionOptions":true,"supportsEvaluateForHovers":true,"supportsModulesRequest":true,"supportsValueFormattingOptions":true,"supportsHitConditionalBreakpoints":true,"supportsSetExpression":true,"supportsLogPoints":true,"supportTerminateDebuggee":true,"supportsCompletionsRequest":true,"exceptionBreakpointFilters":[{"filter":"raised","label":"Raised Exceptions","default":false},{"filter":"uncaught","label":"Uncaught Exceptions","default":true}]}} From Client: Content-Length: 434
{"type":"request","seq":2,"command":"launch","arguments":{"program":"/home/travis/build/DonJayamanne/pythonVSCode/src/test/pythonFiles/debugging/startAndWait.py","cwd":"/home/travis/build/DonJayamanne/pythonVSCode/src/test/pythonFiles/debugging","stopOnEntry":false,"logToFile":true,"debugOptions":["RedirectOutput"],"pythonPath":"/home/travis/virtualenv/python3.7-dev/bin/python","args":[],"envFile":"","port":34528,"type":"python"}} To Client: Content-Length: 283
{"seq":2,"type":"response","request_seq":2,"command":"launch","success":false,"message":"Failed to start the socket server. (Error: listen EADDRINUSE 127.0.0.1:34528)","body":{"error":{"format":"Failed to start the socket server. (Error: listen EADDRINUSE 127.0.0.1:34528)","id":1}}} From Client: Content-Length: 49
{"type":"request","seq":3,"command":"disconnect"} onResponseDisconnect To Client: Content-Length: 81
{"seq":3,"type":"response","request_seq":3,"command":"disconnect","success":true} check and shutdown shutdown Sending Terminated Event To Client: Content-Length: 45
onEventTerminated To Client: {"seq":0,"type":"event","event":"terminated"} Shutting down debug session disposing check and shutdown
Note I tried a bunch of the steps mentioned above, from increasing timeout, etc and none worked. I think the error saying it can't open a socket is very telling. Not sure what would fix that, though. Tried re-installing python, switching Anaconda's environments, no dice. Right now the only way I can get it to run is running Python from command line
I am experiencing the same issue. All I can add is that this happened directly after installing the latest Windows 10 update.
I am experiencing the same issue. All I can add is that this happened directly after installing the latest Windows 10 update.
just like you
confirmed, same problem.
also confirmed, same problem.
confirmed +1
Environment data
Actual behavior
with a simple hello world - click on debugger selection and green run debug symbol, timeout occurs waiting for debugger connection
Expected behavior
Expecting debugger to connect
Steps to reproduce:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)OK, opening the ticket, as Brett suggested was a good idea. I had no idea this was the way to get a error message to trigger off of. I searched the error and found a similar issue. There were several questions there which I will answer here.
Conda install location: C:\PyAna2
.vscode/settings.json, what is python.pythonPath value? I find no settings.json file there, extensions only
Conda env list:
(pandas36) C:\Users\Free Agent>conda env list
conda environments:
#
base C:\PyAna2 pandas36 * C:\PyAna2\envs\pandas36 pdf27 C:\PyAna2\envs\pdf27
Path: (pandas36) C:\Users\Free Agent>path PATH=C:\PyAna2\envs\pandas36;C:\PyAna2\envs\pandas36\Library\mingw-w64\bin;C:\PyAna2\envs\pandas36\Library\usr\bin;C:\PyAna2\envs\pandas36\Library\bin;C:\PyAna2\envs\pandas36\Scripts;C:\PyAna2\envs\pandas36\bin;C:\PyAna2;C:\PyAna2\Library\mingw-w64\bin;C:\PyAna2\Library\usr\bin;C:\PyAna2\Library\bin;C:\PyAna2\Scripts;C:\PyAna2\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\HashiCorp\Vagrant\bin;C:\Program Files\PuTTY\;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Users\Free Agent\AppData\Local\Microsoft\WindowsApps;C:\Users\Free Agent\AppData\Local\GitHubDesktop\bin;C:\Users\Free Agent\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Users\Free Agent\AppData\Local\Microsoft\WindowsApps;
So looks like I should start with the fact there is no settings.json file in .vscode?
I also don't have "conda" on the path, though I do have the conda environments on the path.