Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to debug and select interpreter #1039

Closed
Arpitx opened this issue Mar 12, 2018 · 6 comments
Closed

Unable to debug and select interpreter #1039

Arpitx opened this issue Mar 12, 2018 · 6 comments
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@Arpitx
Copy link

Arpitx commented Mar 12, 2018

Environment data

  • VS Code version: < 1.21.0 >
  • Extension version (available under the Extensions sidebar): < Python Microsoft 2018.2.1 (9th March 2018)>
  • OS and version: < Windows 10 1709 Home>
  • Python version: < 3.6.4 >
  • Type of virtual environment used (if applicable): <N/A >
  • Relevant/affected Python packages and their versions: <Python Microsoft 2018.2.1 (9th March 2018) >

Actual behavior

< After Feb 2018 V-1.21 update, debugger option is not working (I've created folder) and it's showing error 'Debug adapter process has terminated unexpectedly'.
Also I cannot select the interpreter from the command palette, and it shows error message:
"command 'python.setInterpreter' not found". I've tried uninstalling and reinstalling vs code and also disabled the extensions and then checked for running the code either in debugger mode and integrated terminal but nothing works. >

Expected behavior

< Debugger should work perfectly fine and show the tray consisting of start stop and pull over buttons to carry out the debugging session, also by using the combination ctrl + shift + p and choosing the interpreter it should have shown me the current python interpreter installed in my system which it showed earlier perfectly before the latest update >

Steps to reproduce:

  1. < I've just enabled the Python extension from Microsoft and disabled other extensions, to re-create the whole scenario, a zip file is attached. >

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

< Nothing >

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

< nothing >

VScode1.zip

@DonJayamanne
Copy link

Looks like the installation of your Python extension is corrupted.
Please could you uninstall the Python extension, re-install it.
If it still doesn't work, then go into the Extensions directory, delete the Python extension folder and reinstall. (use the command Extensions: Open Extensions Folder to go into the extensions folder)

To keep things simple, please do not debug (lets focus our testing to one area):

  • Open a python file
  • Go into the command Select Python Interpreter
  • Ensure this works before proceeding

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster feature-extension labels Mar 12, 2018
@brettcannon brettcannon changed the title UNABLE TO DEBUG AND SELECT INTERPRETER IN VS CODE V-1.21.0 Unable to debug and select interpreter Mar 12, 2018
@Arpitx
Copy link
Author

Arpitx commented Mar 12, 2018

Thank you very much Sir, your second method i.e. deleting the python extension from python extension folder worked and the code is working normally from the context menu option "Run file in terminal", and select interpreter is also working fine and it showed me to choose the python interpreter installed into my system, Loads of thanks. :)
But now coming to Debugger section, it is showing the error "Time out waiting for debugger connection."
I've attached a .zip file to explain my case.

VSCode_debug.zip

@DonJayamanne
Copy link

Please could you try debugging a simple python file as follows:
print("Hello World")

@Arpitx
Copy link
Author

Arpitx commented Mar 12, 2018

Sir, it is showing the same error as above, "Time out waiting for debugger connection."
And I'm using Python Experimental: Current file (Integrated Terminal)

But then I deleted the .vscode file in my folder and re-run the debugger and it worked fine and showing the debugger tray on the top of my workspace and printed Hello World.

When I used the integrated debugger for my turtle code the debugger worked fine and accepted the inputs perfectly, But when I try to run my turtle code again (via debugger and choosing Python current file as debugger option), it gets stuck after my first input (I know this is irrelevant to the question but if you could help, it would be a great deal), I've attached a .zip file for the same.

P.S. My doubt is cleared regarding aforementioned case, but just wanted to ask the same for the debugging option via Python current file and why my code (which consists of input in turtle code) gets stuck using debugger option as Python current file.

VSCode_debug2.zip

@brettcannon brettcannon added needs verification and removed info-needed Issue requires more information from poster labels Mar 12, 2018
@DonJayamanne
Copy link

DonJayamanne commented Mar 12, 2018

And I'm using Python Experimental: Current file (Integrated Terminal)

When using the Experimental Debugger, you need to have PTVSD 4 installed in your python environment:
Install PTVSD 4: pip install ptvsd --pre

it gets stuck after my first input (I know this is irrelevant to the question but if you could help, it would be a great deal),

You need to use the Python: Integrated Terminal to capture input (i.e. use the terminal when debugging)

Please let me know if this resolves your issues

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs verification labels Mar 12, 2018
@Arpitx
Copy link
Author

Arpitx commented Mar 13, 2018

As stated by you, I installed PTVSD 4 using terminal in vs code and then again when I re-run the file using Experimental debugger (current file), it again gets stuck when arrived at first input.
But I think most of my task can be achieved using integrated terminal and external terminal, so no worries regarding whether current file debugger works or not.
Thanks a ton for your support @DonJayamanne :)

@Arpitx Arpitx closed this as completed Mar 13, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants