Repository navigation
Python debugger won't launch for conda-like envs not returned via conda env list command #18530
Description
Issue Type: Bug
When using the debugger. Nothing happens other than the debug overlay appearing briefly for a second or so.
Same symptoms as this issue
#7927
This happens with python extension version 2022.0.01814523869
It does not happen with previous version 2021.12.1559732655
Expected vs. Actual Behaviour
Expect: degugging session to launch.
Actual: debugging session doesn't launch.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Have python extension version 2022.0.01814523869 installed
Launch python debugger with F5 or via menus.
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.10
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
- Value of the
python.languageServersetting: Pylance
User Settings
defaultLS: {"defaultLSType":"Pylance"}
downloadLanguageServer: true
envFile: "<placeholder>"
venvPath: "<placeholder>"
venvFolders: "<placeholder>"
condaPath: "<placeholder>"
pipenvPath: "<placeholder>"
poetryPath: "<placeholder>"
languageServer: "Pylance"
linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: true
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"
sortImports
• args: "<placeholder>"
• path: "<placeholder>"
formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "black"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"
testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: false
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true
terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"
experiments
• enabled: true
• optInto: []
• optOutFrom: []
insidersChannel: "off"
tensorBoard
• logDirectory: "<placeholder>"
Extension version: 2021.12.1559732655
VS Code version: Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3, 2021-12-15T09:39:46.686Z)
OS version: Linux x64 3.10.0-1160.53.1.el7.x86_64
Restricted Mode: No
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz (4 x 2593) |
| GPU Status | 2d_canvas: unavailable_software gpu_compositing: disabled_software multiple_raster_threads: enabled_on oop_rasterization: disabled_off opengl: disabled_off rasterization: disabled_software skia_renderer: enabled_on video_decode: disabled_software vulkan: disabled_off webgl: unavailable_software webgl2: unavailable_software |
| Load (avg) | 1, 0, 0 |
| Memory (System) | 7.62GB (0.12GB free) |
| Process Argv | --unity-launch --crash-reporter-id 88a94a52-dfc4-4a3b-8c03-b9f21fd70706 |
| Screen Reader | no |
| VM | 100% |
| DESKTOP_SESSION | 1-gnome |
| XDG_CURRENT_DESKTOP | GNOME |
| XDG_SESSION_DESKTOP | 1-gnome |
| XDG_SESSION_TYPE | x11 |
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
pythonvspyl392cf:30425750
pythontb:30283811
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30429732
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30433507
vsclayoutctrt:30437039
vsrem710:30416614
dsvsc008:30436278
vsbas813:30436447
vscscmwlcmt:30438805
vscgsvidc:30438801
helix:30438806
Activity
karthiknadig commentedon Feb 16, 2022
Thomas Crocker (@thomascrocker) This actually looks like #18530, Can you try what is mentioned in the instructions here and share what you get?
#18436 (comment)
If you are using conda make sure it is not this issue from conda conda/conda#11072
thomascrocker commentedon Feb 16, 2022
I am actually using an environment implemented via the "module load" interface. I use in VSCode by simply pasting the path to the interpreter in the bin/ folder of this environment.
I tried the command in #18436 and get this:
It looks like there is a problem with the python extension when starting up, I have installed the latest version of the python extension again, and get this in the python output console when opening my project in vscode:
conda info returns:
karthiknadig commentedon Feb 16, 2022
Thomas Crocker (@thomascrocker) when you use this command you have to put in the environment that you are using, in the command i use
apitest1which is an environment on my machine. From the logs it looks like you are using an environment calledcurrent.The logs seem normal, it is testing out what it can find out about the environments.
Try the above command. Also, can you share your launch.json and settings.json
thomascrocker commentedon Feb 16, 2022
Ah OK, I see..
currentis the name of the module load environment I am using, it's not a conda environment. However I do have conda installed also.This is with the latest version of the extension installed.
My launch.json
And settings.json
karthiknadig commentedon Feb 16, 2022
Thomas Crocker (@thomascrocker) It looks like the path was wrong can you try this?
thomascrocker commentedon Feb 16, 2022
Here you go, the command appears to have hung, or at the very least it's not returned yet:
karthiknadig commentedon Feb 16, 2022
Thomas Crocker (@thomascrocker) Looking at the python path you are using
/opt/scitools/environments/default/current/bin/pythonthat seems to look like a conda environment. From the python logs, it seems likeconda run -n currentseems to be running fine, which indicated it is a conda environment.try running this command to see if it is listed by conda:
That command will not return. The fact you are seeing the json output means that the debugger seems to be able to start. You can kill that process (crtl+c or ctrl+q should do).
The next step is to add
"logToFile": trueto your launch json config and run the debugger. This will generate logs that will be store in this location/net/home/h02/tcrocker/.vscode/extensions/ms-python.python-2022.0.1814523869share all the files that end with*.login that directory.{ "version": "0.2.0", "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "logToFile": true, // <--- ADD THIS "args": [ "recipe_GCM_and_RCM_pan_EU_20220207_101326", "tas", "JJA", "recipe_GCM_global_tas_20220121_172015", "CEU-3", "--shape_file=/home/h02/tcrocker/code/EUCP_WP5_Lines_of_Evidence/shape_files/EUCP_WP3_domains/EUCP_WP3_domains.shp", "--aerosols" ] } ] }thomascrocker commentedon Feb 16, 2022
I wonder if this is getting to the root of the problem. The "current" environment, is a software environment provided centrally via our IT teams and activated on the command line using "module load " functionality. In VSCode though, I just supply the direct path to the interpreter
See for info:
Running conda locally only works I think with environments that are part of my conda install under my username..
So..
(See that current is not listed here)
If you need more info on this "current" environment I may have to tag in someone from our IT team who will understand more about how this works under the hood and alongside my "personal" conda install. It has worked fine with vscode debugging up till this latest version of the extension.
Log file from debugger attached..
debugger.vscode_a95e0b2b-af25-45f2-b41d-11685bc746b3.log
19 remaining items
karrtikr commentedon Apr 4, 2022
Thomas Crocker (@thomascrocker) Can you try installing https://github.com/karrtikr/vscode-python/suites/5930400930/artifacts/202870711 and see if it fixes the issue? Use Extension: Install from VSIX command to install the VSIX.
thomascrocker commentedon Apr 8, 2022
Hiya,
I've not installed the VSIX. A recent batch of centrally installed system updates updated my python extension to
v2022.4.1. Using this version the debugger appears to work correctly. I get the output below in the debugging terminal that launches, and the use of breakpoints, stepping through code etc. works as expected in the IDE.