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.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
karrtikrcommented, Jun 22, 2022

For now you can install an older version of the extension before March as a workaround:

You can follow the prompts from “Extensions: Install Specific Version of Extension…” in the command palette:

image

Or you can open the extensions side bar, click on the settings for the Python extension and pick “Install Another Version…”:

https://user-images.githubusercontent.com/51720070/80000627-39dacc00-8472-11ea-9755-ac7ba0acbb70.gif

0reactions
ludbricommented, Jun 23, 2022

The issue is no longer present after installing the v2022.0.1814523869 of the python extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code terminal doesn't activate Conda environment
PowerShell · Go to the menu bar and click on Terminal. · Type: conda init · Close this terminal and open a new...
Read more >
Efficient Way to Activate Conda in VSCode - Medium
Option 2: Run “conda activate <env-name>” in terminal · CTRL+SHIFT+P open “Preference: Open User Settings (JSON)”. We choose User settings instead of Workspace ......
Read more >
What happens to a running Python script if the computer ...
Upon shutdown, the running processes are terminated. Your interpreter will receive SIGTERM signal on POSIX OSs. If your script handles it, it depends...
Read more >
Create a Python Development Environment with VS Code
In this post, let's see how to set up a clean environment in Windows using Visual Studio Code. First, we need to download...
Read more >
Available CRAN Packages By Date of Publication
2022-12-22, netmeta, Network Meta-Analysis using Frequentist Methods ... Relaxed Lasso Model for Data Which Might Have Long Run Times Using 'glmnet'.
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