Choosing a python interpreter from an existing venv should use the correct python from within the venv
Actual:
Because the venv creates a symlink to the actual binary, VS Code seems to follow that symlink and loads the original Python interpreter. As a result, none of the modules installed within the venv are loaded, and it instead only sees the modules in the system-wide installation.
Warnings are generated for missing modules (which are not missing when the script is run), and context-sensitive help is not available.
Steps to reproduce:
Previously create a venv using python -mvenv venv and install some modules into it using pip
Type: Bug
Behaviour
Expected vs. Actual
Expected:
Actual:
Warnings are generated for missing modules (which are not missing when the script is run), and context-sensitive help is not available.
Steps to reproduce:
python -mvenv venv
and install some modules into it usingpip
venv/bin/python
Diagnostic data
python.languageServer
setting: DefaultUser Settings
``` languageServer: "Pylance" ```
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:57.520Z) OS version: Darwin arm64 22.4.0 Modes:
System Info
|Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabledcanvas_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| |Load (avg)|3, 2, 2| |Memory (System)|16.00GB (0.06GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (25)
Extension|Author (truncated)|Version ---|---|--- dbclient-jdbc|cwe|1.3.4 vscode-postgresql-client2|cwe|7.1.1 vscode-eslint|dba|2.4.4 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|14.9.0 vscode-html-css|ecm|2.0.9 EditorConfig|Edi|0.16.4 prettier-vscode|esb|10.1.0 vscode-graphql|Gra|0.9.3 vscode-graphql-syntax|Gra|1.3.5 vscode-language-babel|mgm|0.0.40 debugpy|ms-|2024.2.0 pylint|ms-|2023.10.1 python|ms-|2024.2.1 vscode-pylance|ms-|2024.3.1 jupyter|ms-|2024.2.0 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.17 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 react-proptypes-intellisense|OfH|1.0.3 vscode-versionlens|pfl|1.9.2 heroku-command|pko|0.0.8 prisma|Pri|5.11.0 vscode-import-cost|wix|3.3.0 (1 theme extensions excluded)