question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python debugger won't launch for conda-like envs not returned via `conda env list` command

See original GitHub issue

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 https://github.com/microsoft/vscode-python/issues/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.languageServer setting: 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® Xeon® 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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:23 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
thomascrockercommented, Apr 8, 2022

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

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.

source activate
conda activate default-2022_03_22
 /usr/bin/env /net/project/ukmo/scitools/opt_scitools/conda/deployments/default-2022_03_22/bin/python /net/home/h02/tcrocker/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/launcher 40739 -- diagnostics/summary_boxplots.py recipe_GCM_and_RCM_pan_Caribbean_20220307_115447 pr DJF recipe_GCM_global_tas_20220301_092144 /home/h02/tcrocker/code/EUCP_WP5_Data_Catalogue/Lines-of-evidence-catalog/summary_plots/test "French Guiana" --shape_file=/home/h02/tcrocker/code/EUCP_WP5_Lines_of_Evidence/shape_files/ne_50m_admin_0_map_units/ne_50m_admin_0_map_units.shp --no_lsm 
12:42:31 [tcrocker@vld372 Lines-of-evidence-catalog]$ source activate
bash: activate: No such file or directory
12:42:31 [tcrocker@vld372 Lines-of-evidence-catalog]$ conda activate default-2022_03_22
Could not find conda environment: default-2022_03_22
You can list all discoverable environments with `conda info --envs`.

12:42:31 [tcrocker@vld372 Lines-of-evidence-catalog]$  /usr/bin/env /net/project/ukmo/scitools/opt_scitools/conda/deployments/default-2022_03_22/bin/python /net/home/h02/tcrocker/.vscode/extensions/ms-python.python-2022.4.1/pythonFiles/lib/python/debugpy/launcher 40739 -- diagnostics/summary_boxplots.py recipe_GCM_and_RCM_pan_Caribbean_20220307_115447 pr DJF recipe_GCM_global_tas_20220301_092144 /home/h02/tcrocker/code/EUCP_WP5_Data_Catalogue/Lines-of-evidence-catalog/summary_plots/test "French Guiana" --shape_file=/home/h02/tcrocker/code/EUCP_WP5_Lines_of_Evidence/shape_files/ne_50m_admin_0_map_units/ne_50m_admin_0_map_units.shp --no_lsm 
0reactions
karrtikrcommented, Apr 5, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I activate my conda environment for VS Code python ...
Running the debugger seems to reset this. See first code block for the message I get. It looks like the terminal isn't in...
Read more >
pdb — The Python Debugger — Python 3.11.1 documentation
The module pdb defines an interactive source code debugger for Python programs. It supports setting (conditional) breakpoints and single stepping at the source ......
Read more >
Using Pip in a Conda Environment - Anaconda
There are a few steps which can be used to avoid broken environments when using conda and pip together. One surefire method is...
Read more >
PyCharm - Configure a conda virtual environment - JetBrains
Press Ctrl+Alt+S to open Settings/Preferences and go to Project: <project name> | Python Interpreter. Click the Add Interpreter link next to the ...
Read more >
Using R in Conda - Biostar
rstudio · Install miniconda · create a new conda environment: conda create -n clermonTyping · install r and r-essentials: conda install -c r...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found