Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rogue conda processes left running after closing vscode (do not use conda run for fetching env variables) #19347

Closed
@ludbri

Description

@ludbri

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Steps to reproduce:

  1. start vscode without any open file
  2. open any .py file, with or without #%% markers
  3. wait for Python task to show up in Task manager grouped under Visual Studio Code
    image
  4. Close VScode and wait for a few seconds
  5. A rogue Python task remains running with high CPU and Power usage
    image

Expected behaviour:

All python processes should close when exiting VScode

Attempted debugging

Disabling the jupyter extension in VSCode solves the problem.

Changing python language server settings as in the issue (with similar symptoms) in #15586. i.e. adding "python.experiments.optOutFrom": ["pythonJediLSP"] and "python.languageServer": "Pylance" to settings.json. This did not solve the problem.

According to the task manager, the command line for the rogue processes is: C:\Anaconda3\python.exe "C:\Anaconda3\Scripts\conda-script.py" "run" "-n" "base" "--no-capture-output" "python" "c:\Users\***\.vscode\extensions\ms-python.python-2022.8.0\pythonFiles\get_output_via_markers.py" "c:/Users/***/.vscode/extensions/ms-pyt

VS Code Version

Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:48:58.283Z)

Jupyter Extension Version

2022.5.1001601848

Jupyter logs

Visual Studio Code (1.68.1, undefined, desktop)
Jupyter Extension Version: 2022.5.1001601848.
Python Extension Version: 2022.8.0.
Workspace folder c:\Users\lu4345br\Work Folders\Documents\Gits\MDP_production_system
info 9:36:54.302: ZMQ install verified.
User belongs to experiment group 'jupyterTest'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 9:36:54.774: LSP Notebooks experiment is disabled -- not using Pylance
info 9:36:54.785: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":["pythonJediLSP"]}
info 9:36:58.461: Process Execution: > c:\Anaconda3\python.exe -m pip list
> c:\Anaconda3\python.exe -m pip list
error 9:37:58.159: Failed to get activated conda env variables for c:\Anaconda3\python.exe
info 9:40:22.403: Loading webview. View is notset
info 9:40:22.405: Loading web view...
info 9:40:22.406: Webview panel created.
info 9:40:23.444: Web view react rendered

Coding Language and Runtime Version

Python v3.8.5

Language Extension Version (if applicable)

v.2022.8.0

Anaconda Version (if applicable)

custom
EDIT: conda version 4.11.0

Running Jupyter locally or remotely?

Local

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions