microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.29k stars 1.18k forks source link

doesn't recognize conda environments inside ubuntu-18.04 subsystem #20322

Closed artinmajdi closed 1 year ago

artinmajdi commented 2 years ago

Type: Bug

  1. create anaconda/miniconda env
  2. load a project in vscode in the ubuntu18.04 subsystem
  3. Install any linter or package inside the conda env and try to call it inside a python code

VS Code version: Code 1.70.0 (da76f93349a72022ca4670c1b84860304616aaa2, 2022-08-04T04:38:16.462Z) OS version: Windows_NT x64 10.0.22000 Modes: Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 2304)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|31.73GB (15.88GB free)| |Process Argv|--crash-reporter-id e181b774-cace-469e-8da8-ff97963ac7d0| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu-18.04| |OS|Linux x64 5.10.102.1-microsoft-standard-WSL2| |CPUs|11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 2303)| |Memory (System)|15.49GB (9.17GB free)| |VM|0%|
Extensions (89) Extension|Author (truncated)|Version ---|---|--- project-manager|ale|12.6.1 vscode-docker-syntax|dun|0.1.5 font-switcher|eva|4.1.0 codespaces|Git|1.10.0 gitpod-desktop|git|0.0.47 vscode-requirements|jan|0.1.0 jupyter-keymap|ms-|1.0.0 remote-containers|ms-|0.241.3 remote-ssh|ms-|0.84.0 remote-ssh-edit|ms-|0.80.0 remote-wsl|ms-|0.66.3 one-dark-theme|msk|1.14.2 material-icon-theme|PKi|4.19.0 matlab-complete|Sla|1.1.1 bootstrap4-vscode|the|6.1.0 python-extended-snippets|tus|0.0.1 vscode-icons|vsc|11.14.0 jinja|who|0.0.8 material-theme|zhu|3.15.2 matlab-formatter|Aff|2.9.1 project-manager|ale|12.6.1 matlab-interactive-terminal|apo|0.4.0 vscode-blink-mind|awe|0.0.10 matlab-extension-pack|bat|0.1.0 vscode-django|bat|1.10.0 markdown-mermaid|bie|1.14.3 matlab-code-run|bra|1.0.2 path-intellisense|chr|2.8.1 gitignore|cod|0.9.0 vscode-markdownlint|Dav|0.47.0 git-extension-pack|don|0.1.3 githistory|don|0.6.19 python-environment-manager|don|1.0.4 python-extension-pack|don|1.7.0 vscode-docker-syntax|dun|0.1.5 parquet-viewer|dvi|2.2.0 gitlens|eam|12.1.2 git-project-manager|fel|1.8.2 docker-explorer|for|0.1.7 vscode-notion|fre|1.1.0 markmap-vscode|ger|0.0.15 matlab|Gim|2.3.1 codespaces|Git|1.10.0 copilot|Git|1.38.6394 copilot-labs|Git|0.2.221 gitpod-remote-ssh|git|0.0.34 cloudcode|goo|1.19.0 gc-excelviewer|Gra|4.2.55 githd|hui|2.3.3 vscode-requirements|jan|0.1.0 nbpreviewer|jit|1.2.2 vsc-python-indent|Kev|1.17.0 google-fonts|lio|0.0.1 zotero|mbl|0.1.10 rainbow-csv|mec|2.4.0 python-path|mge|0.0.11 git-graph|mhu|1.30.0 document|min|2.1.23 vscode-docker|ms-|1.22.1 python|ms-|2022.10.1 vscode-pylance|ms-|2022.8.10 jupyter|ms-|2022.7.1002181843 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.9 one-dark-theme|msk|1.14.2 resourcemonitor|mut|1.0.7 update-python-packages-and-requirements-txt|niz|1.1.7 autodocstring|njp|0.6.1 vscode-drawio-plugin-mermaid|nop|0.1.5 python-dependencies-vscode|pat|0.0.18 material-icon-theme|PKi|4.19.0 pyDocGenAI|pyD|1.0.2 vscode-memory|ser|1.1.0 markdown-preview-enhanced|shd|0.6.3 matlab-complete|Sla|1.1.1 vscode-mindmap|Sou|0.0.5 tabnine-vscode|Tab|3.6.9 bootstrap4-vscode|the|6.1.0 python|tht|0.2.3 python-extended-snippets|tus|0.0.1 pypi-assistant|twi|1.1.2 intellicode-api-usage-examples|Vis|0.2.0 vscodeintellicode|Vis|1.2.22 vscode-icons|vsc|11.14.0 jinja|who|0.0.8 zoombar-vscode|wra|1.4.2 markdown-all-in-one|yzh|3.4.3 material-theme|zhu|3.15.2 vscode-open-in-github|ziy|1.3.6 (25 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931cf:30280410 vshan820:30294714 vstes263cf:30335440 vscoreces:30445986 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 vscscmwlcmt:30465135 cppdebug:30492333 pylanb8912cf:30529770 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 ```
brettcannon commented 1 year ago

This has been fixed in newer releases of the Python extension where we use conda run to avoid activation issues in the terminal. Please try again and if it persists follow the instructions at https://aka.ms/pvsc-bug to file a new issue.