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

Environment variables persisted #24875

Open
stevenh opened this issue Mar 6, 2025 · 0 comments
Open

Environment variables persisted #24875

stevenh opened this issue Mar 6, 2025 · 0 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@stevenh
Copy link

stevenh commented Mar 6, 2025

Type: Bug

Behaviour

I switched virtual environment tools for a project from venv to conda but extensions which used python such as ruff continued to reference the old environment. After hours of digging I found a envVar.txt in the extensions directory which contained environment variables referencing the old and now deleted venv directory. This was resulting in virtual environment configuration for ruff to fail due to the removed venv directory.

Steps to reproduce:

  1. Install Python and Ruff extensions and conda
  2. Create a python workspace and configure ruff (see config below)
  3. Setup a venv in the shell for the project under VS Code python -m venv venv
  4. Activate the environment source venv/bin/activate
  5. Change Default Env Manager manager for the workspace to ms-python.python:conda
  6. Select a conda environment

A basic pyproject.toml which enables ruff:

[tool.ruff]
required-version = ">=0.9.9"
line-length = 100

[tool.ruff.lint]
select = ["ALL"]

The fix was to remove the old deactivate directory, but this was very hard to find as it wasn't associated with workspace in any way.

Diagnostic data

No relavent information from python, error was in the Ruff log, failing to configure python extension as it was trying to run the activate from the old environment.

Extension version: 2025.2.0
VS Code version: Code 1.98.0 (Universal) (6609ac3d66f4eade5cf376d1cb76f13985724bcb, 2025-03-04T21:06:18.612Z)
OS version: Darwin arm64 24.3.0
Modes:
Remote OS version: Linux arm64 6.10.14-linuxkit

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.7
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
autopep8 ms- 2025.2.0
black-formatter ms- 2025.2.0
cmake-tools ms- 1.20.53
code-spell-checker str 4.0.40
copilot Git 1.277.0
copilot-chat Git 0.25.0
cpptools ms- 1.23.6
cpptools-extension-pack ms- 1.3.1
cpptools-themes ms- 2.0.0
csdevkit ms- 1.16.6
csharp ms- 2.63.32
debugpy ms- 2025.4.0
EditorConfig Edi 0.17.1
even-better-toml tam 0.21.2
gitblame wad 11.1.2
github-markdown-preview bie 0.3.0
go gol 0.46.1
html-preview-vscode geo 0.2.5
intellicode-api-usage-examples Vis 0.2.9
isort ms- 2023.10.1
java red 1.40.0
jenkins-doc Maa 1.7.0
jenkins-extension-pack Don 0.1.1
js-debug ms- 1.97.1
js-debug-companion ms- 1.1.3
jupyter ms- 2025.2.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.1.0
kotlin fwc 0.2.36
Kotlin mat 1.7.1
makefile-tools ms- 0.12.17
markdown-all-in-one yzh 3.6.2
markdown-checkbox bie 0.4.0
markdown-emoji bie 0.3.1
markdown-footnotes bie 0.1.1
markdown-mermaid bie 1.27.0
markdown-preview-github-styles bie 2.1.0
markdown-yaml-preamble bie 0.1.0
materialdesignicons-intellisense luk 4.1.0
md-link-checker dly 0.4.0
powershell ms- 2025.0.0
prettier-vscode esb 11.0.0
python ms- 2025.2.0
rainbow-csv mec 3.17.0
remote-containers ms- 0.401.0
remote-wsl ms- 0.88.5
rest-client hum 0.25.1
ruff cha 2025.14.0
rust-analyzer rus 0.3.2330
selected-lines-count gur 1.4.0
test-adapter-converter ms- 0.2.1
vacuum pb3 0.0.7
vs-code-runner Har 2.2.5
vscode-buf buf 0.7.0
vscode-conventional-commits viv 1.26.0
vscode-docker ms- 1.29.4
vscode-dotnet-runtime ms- 2.2.8
vscode-eslint dba 3.0.10
vscode-github-actions git 0.27.1
vscode-gradle vsc 3.16.4
vscode-home-assistant kee 1.43.0
vscode-java-debug vsc 0.58.1
vscode-java-dependency vsc 0.24.1
vscode-java-pack vsc 0.29.0
vscode-java-test vsc 0.43.0
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-just-syntax nef 0.8.0
vscode-markdownlint Dav 0.59.0
vscode-maven vsc 0.44.0
vscode-mocha-test-adapter hbe 2.14.1
vscode-proto3 zxh 0.5.5
vscode-pylance ms- 2025.2.1
vscode-python-envs ms- 0.3.10561010
vscode-test-explorer hbe 2.22.1
vscode-thunder-client ran 2.34.2
vscode-xml red 0.28.0
vscode-yaml red 1.16.0
vscodeintellicode Vis 1.3.2
vscodeintellicode-csharp ms- 2.2.3
vstuc vis 1.1.0
System Info
Item Value
CPUs Apple M3 Max (16 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 2, 2, 2
Memory (System) 48.00GB (0.36GB free)
Process Argv --crash-reporter-id bdc08fa1-0c7a-47e2-b1e5-75fcd9508d56
Screen Reader no
VM 0%
Item Value
Remote Dev Container: Home Assistant Dev @ desktop-linux
OS Linux arm64 6.10.14-linuxkit
CPUs unknown (11 x 0)
Memory (System) 17.54GB (13.14GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
jda6j935:31233686
cp15370_c:31242498
copilothoveron:31248524

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 6, 2025
@karthiknadig karthiknadig self-assigned this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants