You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to get the python environment running in some workspace. When hovering on any shell (powershell, git bash...) I saw that there was no contribution to the python environment mentioned.
It worked when using a fresh data dir. So I looked for the settings causing this.
When I disabled the following two settings, it started working:
Then I tried the new telemetry setting - same issue. As soon as I put the following line in my settings.json, the environment will no longer be activated:
"telemetry.telemetryLevel": "off"
Expected:
Got:
(just openend the same workspace with telemetry disabled)
To me it looks like disabling telemetry will disable some 'experiments' which are required for enabling the python environment integration? At least I can see that there are no experiments enabled when telemetry is disabled, but following experiments are enabled if telemetry is enabled:
Open some python project in VSCode. I created an empty project using pdm init. That will do.
Make that telemetry is disabled as described above.
If telemetry was enabled, restart VSCode.
However over your default terminal (powershell, git bash, ...) to check whether the python extensions contributed anything to the environment.
For me, it doesn't as soon as I disable the VSCode telemetry.
This seems to work fine when running in WSL - but not in native Windows.
Diagnostic data
Output with telemetry disabled for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2024-11-18 17:26:59.445 [info] Telemetry level is off
2024-11-18 17:26:59.445 [info] Experiments are disabled, only manually opted experiments are active.
2024-11-18 17:26:59.445 [warning] Dir "c:\repositories\vsconan-test\.pixi\envs" is not watchable (directory does not exist)
2024-11-18 17:26:59.445 [info] Python interpreter path: .\.venv\Scripts\python.exe
2024-11-18 17:26:59.592 [info] > pyenv which python
2024-11-18 17:26:59.592 [info] cwd: .
2024-11-18 17:27:04.944 [info] Starting Pylance language server.
Output with telemetry enabled for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2024-11-18 17:28:56.587 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-11-18 17:28:56.587 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-11-18 17:28:56.587 [info] Experiment 'pythonTestAdapter' is active
2024-11-18 17:28:56.587 [warning] Dir "c:\repositories\vsconan-test\.pixi\envs" is not watchable (directory does not exist)
2024-11-18 17:28:56.587 [info] Python interpreter path: .\.venv\Scripts\python.exe
2024-11-18 17:28:56.616 [info] > pyenv which python
2024-11-18 17:28:56.616 [info] cwd: .
2024-11-18 17:29:00.839 [info] > & ./.venv/Scripts/Activate.ps1 ; echo 'e8b39361-0157-4923-80e1-22d70d46dee6' ; python ~/.vscode/extensions/ms-python.python-2024.20.0-win32-x64/python_files/printEnvVariables.py
2024-11-18 17:29:00.839 [info] shell: powershellCore
2024-11-18 17:29:01.484 [info] > ~\AppData\Local\Programs\Python\Python311\python.exe ~/.vscode/extensions/ms-python.python-2024.20.0-win32-x64/python_files/printEnvVariables.py
2024-11-18 17:29:01.484 [info] shell: powershellCore
2024-11-18 17:29:01.917 [info] Prepending environment variable PATH in collection with c:\Users\myUserName\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\deactivate\powershell;C:\repositories\vsconan-test\.venv/Scripts; {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-11-18 17:29:01.917 [info] Setting environment variable VIRTUAL_ENV in collection to C:\repositories\vsconan-test\.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-11-18 17:29:01.917 [info] Setting environment variable VIRTUAL_ENV_PROMPT in collection to vsconan-test-3.11 {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-11-18 17:29:01.918 [info] Send text to terminal: & C:/Users/myUserName/AppData/Local/Programs/Python/Python311/python.exe c:\Users\myUserName\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\printEnvVariablesToFile.py c:\Users\myUserName\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\deactivate\powershell\envVars.txt
2024-11-18 17:29:02.215 [info] Starting Pylance language server.
Extension version: 2024.12.0
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Python version (& distribution if applicable, e.g. Anaconda): 3.11.1
Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): VirtualEnvironment
@schwaerz The workaround you have for disabling telemetry is the right one.
The activations should use the command method where it sends the command when experiments are disabled. Did that not work for you? Or were you specifically locking for python environment feature that the experiment enables.
@karthiknadig actively enabling the experiment works for me.
However it took me quite some time to figure that out. Especially since this seems to work fine when running in WSL. Is this as it should be? Is there any documentation available about this somewhere?
Type: Bug
Behaviour
I tried to get the python environment running in some workspace. When hovering on any shell (powershell, git bash...) I saw that there was no contribution to the python environment mentioned.
It worked when using a fresh data dir. So I looked for the settings causing this.
When I disabled the following two settings, it started working:
Then I tried the new telemetry setting - same issue. As soon as I put the following line in my settings.json, the environment will no longer be activated:
Expected:
Got:
(just openend the same workspace with telemetry disabled)
To me it looks like disabling telemetry will disable some 'experiments' which are required for enabling the python environment integration? At least I can see that there are no experiments enabled when telemetry is disabled, but following experiments are enabled if telemetry is enabled:
Steps to reproduce:
pdm init
. That will do.For me, it doesn't as soon as I disable the VSCode telemetry.
This seems to work fine when running in WSL - but not in native Windows.
Diagnostic data
Output with telemetry disabled for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output with telemetry enabled for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.12.0
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Windows_NT x64 10.0.22631
Modes:
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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
The text was updated successfully, but these errors were encountered: