Skip to content

2024.20.0 python extension is unable to find poetry virtual environment if workspace is on a different drive than C (virtual env is cached on different drive than workspace) #24525

@kompre

Description

@kompre

Type: Bug

EDIT 2024/12/04: Upon revision I had to go back to version v2024.10.0 for virtual env to be detected on mapped drive, no solution for samba share type path

Behaviour

I'm using poetry to handle virtual environment and prior to version 2024.20.0 2024.10.0? of the python extension, all worked fine.

With the 2024.20.0 vscode it's unable to find the virtual environment if the the workspace is located in a different drive than the C:\. I've tried with creating a workspace on D:\ (a partition on the same sdd) (actually this works), on Z:\ (a mapped drive), and on \\fileserver\ (a samba drive on the network): nothing work except for a workspace on the C:\ drive (which is where the main OS is installed, and so python and the poetry cache)

Each of the above case used to work, and indeed downgrading to earlier version (2024.18.1 v2024.10.0) fix the issue for mapped drive (samba share \\fileserver\ still missing in action).

Steps to reproduce:

to NOT detect poetry virtual env

  1. upgrade to version 2024.20.0 of python extension
  2. create a workspace on a MAPPED drive different from where python is installed and poetry cache are installed.
  3. create a virtual environment with poetry in the workspace
  4. go to the python tab in vscode and check that no virtual environment is detected.

to detect poetry virtual env

  1. downgrade python extension to v2024.10.0
  2. virtual env is present

Image

Image

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2024-12-03 18:10:11.391 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-12-03 18:10:11.391 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-12-03 18:10:11.391 [info] Experiment 'pythonTestAdapter' is active
2024-12-03 18:10:11.391 [info] Native locator: Refresh started
2024-12-03 18:10:11.391 [info] > pyenv which python
2024-12-03 18:10:11.391 [info] cwd: d:\verifica impianti appesi
2024-12-03 18:10:11.396 [info] Poetry environment manager found at: c:\users\s.follador\.local\bin\poetry.exe
2024-12-03 18:10:11.398 [info] Native locator: Refresh finished in 354 ms
2024-12-03 18:10:11.404 [info] Running installed packages checker:  {
  id: 'C:\\Users\\s.follador\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\gvia-PlAX_Yoa-py3.12\\Scripts\\python.exe',
  sysPrefix: 'C:\\Users\\s.follador\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\gvia-PlAX_Yoa-py3.12',
  envType: 'Venv',
  envName: 'gvia-PlAX_Yoa-py3.12',
  envPath: 'C:\\Users\\s.follador\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\gvia-PlAX_Yoa-py3.12\\Scripts\\python.exe',
  path: 'C:\\Users\\s.follador\\AppData\\Local\\pypoetry\\Cache\\virtualenvs\\gvia-PlAX_Yoa-py3.12\\Scripts\\python.exe',
  architecture: 3,
  sysVersion: '',
  version: {
    raw: '3.12.4',
    major: 3,
    minor: 12,
    patch: 4,
    build: [],
    prerelease: []
  },
  displayName: "Python 3.12.4 ('gvia-PlAX_Yoa-py3.12')",
  detailedDisplayName: "Python 3.12.4 ('gvia-PlAX_Yoa-py3.12')",
  type: 'Virtual'
} c:\Users\s.follador\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\installed_check.py d:\verifica impianti appesi\pyproject.toml
2024-12-03 18:10:11.404 [info] > ~\AppData\Local\pypoetry\Cache\virtualenvs\gvia-PlAX_Yoa-py3.12\Scripts\python.exe ~\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\installed_check.py "d:\verifica impianti appesi\pyproject.toml"
2024-12-03 18:10:11.404 [info] Python interpreter path: ~\AppData\Local\pypoetry\Cache\virtualenvs\gvia-PlAX_Yoa-py3.12\Scripts\python.exe
2024-12-03 18:10:11.723 [info] > ~\AppData\Local\Programs\Python\Python312\python.exe ~/.vscode/extensions/ms-python.python-2024.20.0-win32-x64/python_files/printEnvVariables.py
2024-12-03 18:10:11.723 [info] shell: powershellCore
2024-12-03 18:10:11.917 [info] Setting environment variable PATHEXT in collection to .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-12-03 18:10:11.918 [info] Setting environment variable PSMODULEPATH in collection to C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-12-03 18:10:11.918 [info] Prepending environment variable PATH in collection to c:\Users\s.follador\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\deactivate\powershell;C:\Users\s.follador\AppData\Local\pypoetry\Cache\virtualenvs\gvia-PlAX_Yoa-py3.12\Scripts;C:\Program Files\BraveSoftware\Brave-Browser\Application;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\libfabric\bin\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\libfabric\bin\utils;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64\bin;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\ia32;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Common Files\Concrete\Maintenance;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\gs\gs10.04.0\bin;C:\Program Files\WireGuard\;C:\Program Files\PowerShell\7\;C:\Program Files\Docker\Docker\resources\bin;C:\Users\s.follador\AppData\Local\Programs\Quarto\bin;C:\Users\s.follador\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\s.follador\AppData\Local\Programs\Python\Python312\;C:\Users\s.follador\AppData\Local\Programs\Python\Launcher\;C:\Users\s.follador\AppData\Local\Microsoft\WindowsApps;C:\Users\s.follador\AppData\Local\Programs\Microsoft VS Code\bin;c:\users\s.follador\appdata\roaming\python\python312\scripts;c:\users\s.follador\.local\bin;C:\Program Files\SumatraPDF; {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-12-03 18:10:11.918 [info] Send text to terminal: & C:/Users/s.follador/AppData/Local/Programs/Python/Python312/python.exe c:\Users\s.follador\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\printEnvVariablesToFile.py c:\Users\s.follador\.vscode\extensions\ms-python.python-2024.20.0-win32-x64\python_files\deactivate\powershell\envVars.txt
2024-12-03 18:10:12.804 [info] Starting Pylance language server.
2024-12-03 18:10:13.969 [info] Native locator: Refresh started
2024-12-03 18:10:13.970 [info] Native locator: Refresh started
2024-12-03 18:10:13.990 [info] Send text to terminal: Get-ChildItem env: | Out-File "C:\Users\S8DA4~1.FOL\AppData\Local\Temp\tmp-286286W6HMNXwdjAQ.txt"
2024-12-03 18:10:14.019 [info] Poetry environment manager found at: c:\users\s.follador\.local\bin\poetry.exe
2024-12-03 18:10:14.043 [info] Native locator: Refresh finished in 79 ms

Extension version: 2024.20.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.12.4
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
Black Formatter ms-python.black-formatter 2024.4.0
Code Spell Checker streetsidesoftware.code-spell-checker 4.0.21
Codeium: AI Coding Autocomplete and Chat for Python, Javascript, Typescript, Java, Go, and more Codeium.codeium 1.24.8
Dev Containers ms-vscode-remote.remote-containers 0.388.0
Django batisteo.vscode-django 1.15.0
Even Better TOML tamasfe.even-better-toml 0.19.2
IntelliCode VisualStudioExptTeam.vscodeintellicode 1.3.2
IntelliCode API Usage Examples VisualStudioExptTeam.intellicode-api-usage-examples 0.2.9
Italian - Code Spell Checker streetsidesoftware.code-spell-checker-italian 1.1.2
JavaScript Debugger ms-vscode.js-debug 1.95.3
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.3
Jinja wholroyd.jinja 0.0.8
Jupyter ms-toolsai.jupyter 2024.10.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Keymap ms-toolsai.jupyter-keymap 1.1.2
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.21
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Markdown All in One yzhang.markdown-all-in-one 3.6.2
Paste Image mushan.vscode-paste-image 1.0.4
PostScript Language mxschmitt.postscript 1.0.1
PostScript Snippets yingquelou.postscriptsnippets 0.1.2
PowerShell ms-vscode.powershell 2024.4.0
Pylance ms-python.vscode-pylance 2024.11.3
Python ms-python.python 2024.20.0
Python Debugger ms-python.debugpy 2024.12.0
Python Environment Manager donjayamanne.python-environment-manager 1.2.4
Python Extension Pack donjayamanne.python-extension-pack 1.7.0
Python Indent KevinRose.vsc-python-indent 1.18.0
Python Poetry zeshuaro.vscode-python-poetry 0.17.30
Quarto quarto.quarto 1.118.0
Rainbow CSV mechatroner.rainbow-csv 3.13.0
Sumatra Tools lenagain.sumatra-tools 0.0.6
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
vscode-pdf tomoki1207.pdf 1.2.2
WSL ms-vscode-remote.remote-wsl 0.88.5
YAML redhat.vscode-yaml 1.15.0
System Info
Item Value
CPUs AMD Ryzen 9 7950X 16-Core Processor (32 x 4491)
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.15GB (18.55GB free)
Process Argv --crash-reporter-id dfce97a7-5350-4039-9b7a-52d8f0fe6f9a
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions