-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
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:
// "telemetry.enableTelemetry": false,
// "telemetry.enableCrashReporter": false,
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:
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
724cj586:31013169
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
impr_priority:31102340
nativerepl1:31139838
pythonrstrctxt:31112756
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31181875
Steps to reproduce:
- 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
| Item | Value |
|---|---|
| CPUs | 12th Gen Intel(R) Core(TM) i7-12800H (20 x 2803) |
| 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 vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | undefined |
| Memory (System) | 31.58GB (9.10GB free) |
| Process Argv | --user-data-dir ../test ../vsconan-test/ --crash-reporter-id daecb4ec-d188-4b9e-bd89-eabda3004a8a |
| Screen Reader | no |
| VM | 0% |

