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

Timeout waiting for debugger connection when using Windows PowerShell #2732

Closed
F8F-Bearcat opened this issue Sep 30, 2018 · 99 comments
Closed
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@F8F-Bearcat
Copy link

F8F-Bearcat commented Sep 30, 2018

Environment data

  • VS Code version: 1.27.2
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Windows 10 professional release 10.0.17134
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 2.7 with Python 3.6.5 conda virtual environment
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: simple helloworld.py no imports

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:

  1. open hello.py file
  2. click on debug spider symbol on left vertical bar

Logs

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

##########Linting Output - pylint##########

--------------------------------------------------------------------

Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)

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

 INFO no standard startup: panel is active
console.ts:136 [Extension Host] vscode-icons is active!
console.ts:136 [Extension Host] Git extension API method 'getGitPath' is deprecated.
t.log @ console.ts:136
console.ts:136 [Extension Host] Python Extension: Failed to get conda environment list from conda Error: spawn conda ENOENT
	at _errnoException (util.js:1024:11)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
	at onErrorNT (internal/child_process.js:372:16)
	at _combinedTickCallback (internal/process/next_tick.js:138:11)
	at process._tickCallback (internal/process/next_tick.js:180:9)

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

> 
(pandas36) C:\Users\Free Agent>conda list
# packages in environment at C:\PyAna2\envs\pandas36:
#
# Name                    Version                   Build  Channel
arrow                     0.12.1                   py36_2    conda-forge
arrow-cpp                 0.9.0               py36_vc14_7  [vc14]  conda-forge
asn1crypto                0.24.0                   py36_0
astroid                   2.0.4                     <pip>
backcall                  0.1.0                    py36_0
binaryornot               0.4.4                      py_1    conda-forge
bleach                    2.1.3                    py36_0
blinker                   1.4                      py36_0
bokeh                     0.12.15                  py36_0
boost-cpp                 1.66.0                   vc14_1  [vc14]  conda-forge
ca-certificates           2018.8.24            ha4d7672_0    conda-forge
certifi                   2018.8.24                py36_0    conda-forge
cffi                      1.11.5           py36h945400d_0
chardet                   3.0.4            py36h420ce6e_1
chardet                   3.0.4                     <pip>
click                     6.7              py36hec8c647_0
cloudpickle               0.5.2                    py36_1
colorama                  0.3.9            py36h029ae33_0
cookiecutter              1.6.0                    py36_0    conda-forge
cryptography              2.2.2            py36hfa6e2cd_0
cycler                    0.10.0           py36h009560c_0
cytoolz                   0.9.0.1          py36hfa6e2cd_0
dask                      0.17.2                   py36_0
dask-core                 0.17.2                   py36_0
datashape                 0.5.4            py36h5770b85_0
decorator                 4.3.0                    py36_0
distributed               1.21.6                   py36_0
entrypoints               0.2.3            py36hfd66bb0_2
et_xmlfile                1.0.1            py36h3d2d736_0
feather-format            0.4.0               py36_vc14_2  [vc14]  conda-forge
freetype                  2.8.1                    vc14_0  [vc14]  conda-forge
future                    0.16.0                   py36_2    conda-forge
gitdb2                    2.0.3                     <pip>
GitPython                 2.1.9                     <pip>
graphviz                  2.38.0                        4    anaconda
heapdict                  1.0.0                    py36_2
html5lib                  1.0.1            py36h047fa9f_0
icc_rt                    2017.0.4             h97af966_0
icu                       58.2                     vc14_0  [vc14]  conda-forge
idna                      2.6              py36h148d497_1
idna                      2.6                       <pip>
intel-openmp              2018.0.0                      8
ipykernel                 4.8.2                    py36_0
ipython                   6.3.1                    py36_0
ipython_genutils          0.2.0            py36h3c5d0ee_0
ipywidgets                7.2.1                    py36_0
isort                     4.3.4                     <pip>
jdcal                     1.4                      py36_0
jedi                      0.12.0                   py36_1
jinja2                    2.10             py36h292fed1_0
jinja2-time               0.2.0                      py_2    conda-forge
jpeg                      9b                       vc14_2  [vc14]  conda-forge
jsonschema                2.6.0            py36h7636477_0
jupyter                   1.0.0                    py36_4
jupyter_client            5.2.3                    py36_0
jupyter_console           5.2.0            py36h6d89b47_1
jupyter_core              4.4.0            py36h56e9d50_0
jupyterthemes             0.19.1                    <pip>
kaggle                    1.3.8                     <pip>
kiwisolver                1.0.1            py36h12c3424_0
lazy-object-proxy         1.3.1                     <pip>
lesscpy                   0.13.0                    <pip>
libpng                    1.6.34                   vc14_0  [vc14]  conda-forge
libsodium                 1.0.16                   vc14_0  [vc14]  conda-forge
libtiff                   4.0.8           vc14h04e2a1e_10  [vc14]  anaconda
lifelines                 0.14.1                    <pip>
llvmlite                  0.22.0           py36ha794a7c_0
locket                    0.2.0            py36hfed976d_1
lxml                      4.2.1                     <pip>
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markdown                  2.6.11                     py_0    conda-forge
markupsafe                1.0              py36h0e26971_1
matplotlib                2.2.2                    py36_1    conda-forge
mccabe                    0.6.1                     <pip>
missingno                 0.4.0                      py_0    conda-forge
mistune                   0.8.3            py36hfa6e2cd_1
mkl                       2018.0.2                      1
mkl_fft                   1.0.1            py36h452e1ab_0
mkl_random                1.0.1            py36h9258bd6_0
msgpack-python            0.5.6            py36he980bc4_0
msys2-conda-epoch         20160418                      1
multipledispatch          0.5.0                    py36_0
nbconvert                 5.3.1            py36h8dc0fde_0
nbdime                    0.4.1                     <pip>
nbformat                  4.4.0            py36h3a5bc1b_0
networkx                  2.1                      py36_0
notebook                  5.4.1                    py36_0
numba                     0.37.0          np114py36hea3a760_0
numpy                     1.14.2           py36h5c71026_1
oauthlib                  2.1.0                    py36_0
odo                       0.5.1            py36h7560279_0
olefile                   0.45.1                   py36_0
openpyxl                  2.5.3                    py36_0
openssl                   1.0.2p            hfa6e2cd_1000    conda-forge
packaging                 17.1                     py36_0
pandas                    0.22.0           py36h6538335_0
pandas-datareader         0.6.0                     <pip>
pandoc                    1.19.2.1             hb2460c7_1    anaconda
pandocfilters             1.4.2            py36h3ef6317_1
parquet-cpp               1.4.0                    vc14_0  [vc14]  conda-forge
parso                     0.2.0                    py36_0
partd                     0.3.8            py36hc8e763b_0
patsy                     0.5.0                    py36_0
pickleshare               0.7.4            py36h9de030f_0
pillow                    4.2.1            py36hdb25ab2_0    anaconda
pip                       18.0                      <pip>
pip                       9.0.3                    py36_0
plotly                    2.5.1                    py36_0
ply                       3.11                      <pip>
poyo                      0.4.1                      py_1    conda-forge
prompt_toolkit            1.0.15           py36h60b8f86_0
psutil                    5.4.5            py36hfa6e2cd_0
ptvsd                     4.1.3                     <pip>
pweave                    0.30.2                   py36_0    conda-forge
pyarrow                   0.9.0               py36_vc14_1  [vc14]  conda-forge
pycparser                 2.18             py36hd053e01_1
pygments                  2.2.0            py36hb010967_0
pyjwt                     1.6.4                    py36_0
pylint                    2.1.1                     <pip>
pyopenssl                 17.5.0           py36h5b7d817_0
pyparsing                 2.2.0            py36h785a196_1
pyqt                      5.6.0                    py36_2
pysocks                   1.6.8                    py36_0
python                    3.6.5                h0c2934d_0
python-dateutil           2.7.2                    py36_0
pytz                      2018.4                   py36_0
pywinpty                  0.5.1                    py36_0
pyyaml                    3.12             py36h1d1928f_1
pyzmq                     17.0.0           py36hfa6e2cd_1
qt                        5.6.2                    vc14_1  [vc14]  conda-forge
qtconsole                 4.3.1            py36h99a29a9_0
regex                     2018.02.21       py36hfa6e2cd_0
requests                  2.18.4                    <pip>
requests                  2.18.4           py36h4371aae_1
requests-file             1.4.3                     <pip>
requests-ftp              0.3.1                     <pip>
requests-oauthlib         0.8.0                    py36_1
scikit-learn              0.19.1           py36h53aea1b_0
scipy                     1.0.1            py36hce232c7_0
seaborn                   0.8.1            py36h9b69545_0
selenium                  3.11.0                   py36_0
send2trash                1.5.0                    py36_0
setuptools                39.0.1                   py36_0
simplegeneric             0.8.1                    py36_2
simplejson                3.15.0           py36hfa6e2cd_0
sip                       4.19.8           py36h6538335_0
six                       1.11.0           py36h4db2310_1
smmap2                    2.0.3                     <pip>
snappy                    1.1.7                    vc14_1  [vc14]  conda-forge
sortedcontainers          1.5.10                   py36_0
sqlite                    3.22.0                   vc14_0  [vc14]  conda-forge
statsmodels               0.8.0            py36h6189b4c_0
tblib                     1.3.2            py36h30f5020_0
terminado                 0.8.1                    py36_1
testpath                  0.3.1            py36h2698cfe_0
tk                        8.6.7            vc14hb68737d_1  [vc14]  anaconda
toolz                     0.9.0                    py36_0
tornado                   5.0.2                    py36_0
traitlets                 4.3.2            py36h096827d_0
twython                   3.7.0                    py36_0
typed-ast                 1.1.0                     <pip>
urllib3                   1.22             py36h276f60a_0
urllib3                   1.22                      <pip>
vc                        14                   h0510ff6_3
vs2015_runtime            14.0.25123                    3
wcwidth                   0.1.7            py36h3d5aa90_0
webencodings              0.5.1            py36h67c50ae_1
wheel                     0.31.0                   py36_0
whichcraft                0.4.1                      py_1    conda-forge
widgetsnbextension        3.2.1                    py36_0
win_inet_pton             1.0.1            py36he67d7fd_1
wincertstore              0.2              py36h7fe50ca_0
winpty                    0.4.3                    vc14_2  [vc14]  conda-forge
wrapt                     1.10.11                   <pip>
xlwt                      1.3.0            py36h1a4751e_0
yaml                      0.1.7                    vc14_0  [vc14]  conda-forge
zeromq                    4.2.5                    vc14_1  [vc14]  conda-forge
zict                      0.1.3            py36h2d8e73e_0
zlib                      1.2.11                   vc14_0  [vc14]  conda-forge

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.

@F8F-Bearcat
Copy link
Author

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

@F8F-Bearcat
Copy link
Author

Also, this is Windows 10 professional release 10.0.17134

@F8F-Bearcat
Copy link
Author

Dug into conda location.
I have conda.bat located in C:\PyAna2\Library\bin
I also have C:\PyAna2\Library\bin on my path

@DonJayamanne
Copy link

  • Please could you confirm the following file exists:
    C:\PyAna2\envs\pandas36\python.exe
  • Please modify settings.json to add the file path as follows:
    "python.pythonPath": "C:\\PyAna2\\envs\\pandas36\\python.exe",

Note, this is a JSON file hence back slashes need to be encoded.

@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug area-debugging info-needed Issue requires more information from poster labels Sep 30, 2018
@F8F-Bearcat
Copy link
Author

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.

image

@F8F-Bearcat
Copy link
Author

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

@F8F-Bearcat
Copy link
Author

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?

@DonJayamanne
Copy link

Please send a screen shot of the contents in settings.json
To install the vsix, just uninstall the python extension and quit vscode.

@MandarJKulkarni
Copy link

MandarJKulkarni commented Oct 2, 2018

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

@DonJayamanne
Copy link

DonJayamanne commented Oct 2, 2018

@MandarJKulkarni

, if any of the module imports fails

Please elaborate on this. How do you know about this failure,

@F8F-Bearcat
Copy link
Author

for Mandar: my issue occurs with or without the in-development vsix build

my user settings.json:
image

my workspace settings.json
image

@DonJayamanne
Copy link

@F8F-Bearcat

  • Please debug a simple python program with a for loop
  • Debug and seen screen shot of error message and contents of the terminal window

Next:

  • Please right click on the file and select the context menu option 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.

@F8F-Bearcat
Copy link
Author

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.

image

Run Python in Terminal yields:

image

@F8F-Bearcat
Copy link
Author

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.

@F8F-Bearcat
Copy link
Author

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.....

image

@DonJayamanne
Copy link

@MandarJKulkarni @F8F-Bearcat Please could you both try the following

Item 1

  • Go into settings.json and add the following setting
    "python.terminal.actiavteEnvironment": false
  • Try debugging

Item 2: If previous step doesn't work

  • Change your shell from powershell to command prompt
    Open your command palette and select Terminal: Select Default Shell.
    Select Command Prompt
  • Try debugging

Please do send screenshots, that helps a lot.
@F8F-Bearcat Thanks for the great screenshots.

@F8F-Bearcat
Copy link
Author

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.

image

@MandarJKulkarni
Copy link

@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.

@F8F-Bearcat
Copy link
Author

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.

image

@F8F-Bearcat
Copy link
Author

Should I remove the activateEnvironment flag as it did not change the behavior? In the spirit of just changing one thing at a time.

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

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.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster and removed needs verification labels Oct 3, 2018
@F8F-Bearcat
Copy link
Author

F8F-Bearcat commented Oct 3, 2018

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"

image

@DonJayamanne
Copy link

when I hover over it I get "Property timeout is not allowed"

Yes, that's fine.

@PCJimmmy
Copy link

PCJimmmy commented Oct 12, 2018 via email

@srirambm

This comment has been minimized.

@brettcannon brettcannon changed the title Python Timeout waiting for debugger connection when using Anaconda Timeout waiting for debugger connection when using Windows PowerShell Oct 12, 2018
@ninja-asa
Copy link

@DonJayamanne

Yes, only by disabling the auto-activation of the environment I stop getting the error aforementioned "Timeout waiting for debugger connection"

    "python.terminal.activateEnvironment": false,
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",

@HughGrovesArup
Copy link

Same settings as @ninja-asa work for me

@srirambm
Copy link

@DonJayamanne

Yes, only by disabling the auto-activation of the environment I stop getting the error aforementioned "Timeout waiting for debugger connection"

    "python.terminal.activateEnvironment": false,
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",

Nope just went back to 1.27.2
changed settings as mentioned
restarted and getting the same timeout error

@srirambm
Copy link

I can get debugger and everything fine if I change my python interpreter to something else other than any of conda environments

@brettcannon
Copy link
Member

We believe there are two issues going on (PowerShell not activating fast enough under conda to get the debug command, and a potential issue related to the Windows 10 October 2018 release regardless of environment activation), and due to the amount of comments here it has become hard for us to tell what configurations are leading to failures. If people can provide the following it would be really helpful:

  1. The information listed in the table below (I will update it as people's responses come in)
  2. A screenshot of the failure (please try to capture your status bar so we can see the Python details as well as the terminal output)

A massive thanks to anyone able to provide details regarding this!

VS Code version Python extension version Windows 10 version ("About your PC") PowerShell version (`$PSVersionTable.PSVersion`) Python version Python environment Environment activation (`"python.terminal.activateEnvironment"`) Debugging works
1.28.1 2018.9.0 Windows 10 1803 PS 5.1 17134 Python 3.7.0 venv `true` Y
1.28.1 2018.9.0 Windows 10 1803 PS 5.1 17134 Python 3.7.0 conda 4.5.11 `false` Y
1.28.1 2018.9.0 Windows 10 1803 PS 5.1 17134 Python 3.7.0 conda 4.5.11 `true` **N**

capture

@ninja-asa

This comment has been minimized.

@graywolfcorp

This comment has been minimized.

@DonJayamanne

This comment has been minimized.

@graywolfcorp
Copy link

for print("hello")

Default Shell set to Powershell
"python.terminal.activateEnvironment": true

Debugging works: N - timeout

Default Shell set to Powershell
"python.terminal.activateEnvironment": false

Debugging works: Y

Default Shell set to cmd
"python.terminal.activateEnvironment": false

Debugging works: Y

Default Shell set to cmd
"python.terminal.activateEnvironment": true

Debugging works: Y

launch.json
{
"name": "Python: Terminal (integrated)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
},
psfalse
pstrue

@PCJimmmy
Copy link

PCJimmmy commented Oct 12, 2018 via email

@DonJayamanne
Copy link

@PCJimmmy

Two machines – both showing identical response – both running a long script that I don’t want to kill at the present.

Please could you try running a new simple script such as print("Hello")

@timeregained
Copy link

Same issues repeated on 3 different PC.

All the configuration are all the same as below:

VS Code version Python extension version Windows 10 version ("About your PC") PowerShell version ($PSVersionTable.PSVersion) Python version Python environment Environment activation ("python.terminal.activateEnvironment") Debugging works
1.28.1 2018.9.0 Windows 10 1709 PS 5.1 16299 Python 3.7.0 conda 5.3 true N

image

@brettcannon
Copy link
Member

Thanks to everyone for the help! We're fairly certain we have eliminated the Windows 10 October 2018 worry and corroborated that this is all because our hack around conda's lack of PowerShell support just isn't robust enough based on the APIs that VS Code provides us. We are going to get a fix out that will let you know that conda + PowerShell are not a good combination for debugging (conda should have the support necessary in conda 4.6). We will also make it easy to switch your terminal over to command prompt so that you can still debug with an activated conda environment. Otherwise you can disable environment activation and stick with PowerShell if you prefer while still being able to debug.

@HassanAbbas92
Copy link

HassanAbbas92 commented Oct 16, 2018

just open the lauch.json file and add the following configuration:

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

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

@brettcannon
Copy link
Member

@Beta3-Data yes, but it won't activate your conda environment either which many people want/expect.

@srirambm
Copy link

just open the lauch.json file and add the following configuration:

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

just did this and issue continues, I have set two things
activate environment to false
added the above into launch.json

am I the only one with the issue, please I see others have closed it.
I am trying to use python for testing azure functions other than using C#.
and thought vs code with its deep integration will be useful.

@brettcannon
Copy link
Member

@srirambm if you are using conda w/ PowerShell then either don't use conda or switch to Command Prompt. If you're not using conda w/ PowerShel then you have a different issue.

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests