Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreter selection: virtualenvs from python.venvFolders are missing #23990

Closed
eladsegal opened this issue Aug 25, 2024 · 3 comments
Closed
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@eladsegal
Copy link

eladsegal commented Aug 25, 2024

Type: Bug

Behaviour

When selecting the python interpreter, virtualenvs from python.venvFolders are missing.
The issue is present in VS Code 1.93.0-insider but not in 1.92.2.

Steps to reproduce:

  1. Create a virtualenv somewhere under the home directory, for example:
mkdir ~/envs_dir
python -m venv ~/envs_dir/myenv
  1. Set python.venvFolders to ["envs_dir"]
  2. Open the Command Palette and select Python: Select Interpreter.
  3. Even after refreshing, the virtualenv myenv won't be available for selection.

Diagnostic data

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

2024-08-26 00:07:32.456 [info] Experiment 'pythonCreateEnvOnPipInstall' is active
2024-08-26 00:07:32.456 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-08-26 00:07:32.456 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-08-26 00:07:32.456 [info] Experiment 'pythonTestAdapter' is active
2024-08-26 00:07:32.456 [info] Native locator: Refresh started
2024-08-26 00:07:32.456 [info] Default formatter is set to ms-python.black-formatter for workspace /home/ubuntu/workspace/loora
2024-08-26 00:07:32.486 [info] Poetry environment manager found at: /home/ubuntu/.local/bin/poetry
2024-08-26 00:07:32.496 [info] > ~/.pyenv/bin/pyenv which python
2024-08-26 00:07:32.496 [info] cwd: .
2024-08-26 00:07:32.497 [info] Pyenv environment manager found at: /home/ubuntu/.pyenv/bin/pyenv
2024-08-26 00:07:32.527 [info] Native locator: Refresh finished in 537 ms
2024-08-26 00:07:32.643 [info] Python interpreter path: /bin/python
2024-08-26 00:07:33.523 [info] > pixi --version
2024-08-26 00:07:33.527 [warning] could not find a pixi interpreter for the interpreter at /bin/python
2024-08-26 00:07:34.119 [warning] could not find a pixi interpreter for the interpreter at /bin/python
2024-08-26 00:07:35.963 [info] Starting Pylance language server.
2024-08-26 00:08:04.686 [info] Native locator: Refresh started
2024-08-26 00:08:04.691 [info] Poetry environment manager found at: /home/ubuntu/.local/bin/poetry
2024-08-26 00:08:04.691 [info] Pyenv environment manager found at: /home/ubuntu/.pyenv/bin/pyenv
2024-08-26 00:08:04.854 [info] Native locator: Refresh finished in 166 ms
2024-08-26 00:08:06.813 [info] Native locator: Refresh started
2024-08-26 00:08:06.820 [info] Poetry environment manager found at: /home/ubuntu/.local/bin/poetry
2024-08-26 00:08:06.820 [info] Pyenv environment manager found at: /home/ubuntu/.pyenv/bin/pyenv
2024-08-26 00:08:06.980 [info] Native locator: Refresh finished in 168 ms

Output for Python Locator in the Output panel

2024-08-26 00:08:06.818 [info] Discovered manager: (Poetry) /home/ubuntu/.local/bin/poetry
2024-08-26 00:08:06.820 [info] Discovered manager: (Pyenv) /home/ubuntu/.pyenv/bin/pyenv
2024-08-26 00:08:06.905 [info] Discovered env: /usr/bin/python
2024-08-26 00:08:06.906 [info] Discovered env: /bin/python
2024-08-26 00:08:06.979 [info] Locator Conda took 75.060344ms
2024-08-26 00:08:06.979 [info] Locator Homebrew took 297.023µs
2024-08-26 00:08:06.979 [info] Locator LinuxGlobal took 91.903177ms
2024-08-26 00:08:06.979 [info] Locator PipEnv took 187.425µs
2024-08-26 00:08:06.979 [info] Locator Poetry took 1.089197ms
2024-08-26 00:08:06.979 [info] Locator PyEnv took 1.26624ms
2024-08-26 00:08:06.979 [info] Locator Venv took 79.506µs
2024-08-26 00:08:06.979 [info] Locator VirtualEnv took 126.658µs
2024-08-26 00:08:06.980 [info] Locator VirtualEnvWrapper took 145.253µs
2024-08-26 00:08:06.980 [info] Locator GlobalVirtualEnvs took 8.072391ms
2024-08-26 00:08:06.980 [info] Locator Locators took 93.143714ms
2024-08-26 00:08:06.980 [info] Locator Path took 164.685824ms
2024-08-26 00:08:06.980 [info] Locator Workspaces took 80.923759ms
2024-08-26 00:08:06.980 [info] Refresh completed in 164ms

Extension version: 2024.13.2024082201
VS Code version: Code - Insiders 1.93.0-insider (36e4ddb4dbdf5d41bbeedfce2db4834085de2b87, 2024-08-23T06:45:56.108Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 6.5.0-1023-aws

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.12
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Pylance
User Settings


venvFolders: "<placeholder>"

languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
Black Formatter ms-python.black-formatter 2024.3.12071014
Compare Folders moshfeu.compare-folders 0.24.3
Data Wrangler ms-toolsai.datawrangler 1.7.2
Docker ms-azuretools.vscode-docker 1.29.2
EditorConfig for VS Code EditorConfig.EditorConfig 0.16.4
Git Graph mhutchie.git-graph 1.30.0
GitHub Actions github.vscode-github-actions 0.26.3
GitHub Copilot GitHub.copilot 1.223.1065
GitHub Copilot Chat GitHub.copilot-chat 0.20.2024082301
GitLens — Git supercharged eamodio.gitlens 15.3.1
IntelliCode VisualStudioExptTeam.vscodeintellicode 1.3.1
IntelliCode API Usage Examples VisualStudioExptTeam.intellicode-api-usage-examples 0.2.8
isort ms-python.isort 2023.13.12321012
JavaScript Debugger ms-vscode.js-debug 1.92.0
Jupyter ms-toolsai.jupyter 2024.8.2024081201
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.19
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Makefile Tools ms-vscode.makefile-tools 0.10.26
Partial Diff ryu1kn.partial-diff 1.4.3
Pylance ms-python.vscode-pylance 2024.8.101
Python ms-python.python 2024.13.2024082201
Python Debugger ms-python.debugpy 2024.11.2024081401
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.9
System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i7-12700H (20 x 2688)
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.70GB (12.71GB free)
Process Argv --crash-reporter-id 683754ab-be3b-4724-9aa9-f2a7cfc85650
Screen Reader no
VM 0%
Item Value
Remote SSH: elad-dev-cpu
OS Linux x64 6.5.0-1023-aws
CPUs Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz (4 x 0)
Memory (System) 15.41GB (10.16GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256197
vscod805:30301674
vsaa593:30376534
py29gd2263:31024238
vscaat:30438846
c4g48928:30535728
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonnoceb:30776497
asynctok:30898717
dsvsc014:30777825
dsvsc015:30821418
pythonregdiag2:30926734
pythonmypyd1:30859725
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
cppperfnew:30980852
pythonait:30973460
01bff139:31013167
a69g1124:31018687
dvdeprecation:31040973
dwnewjupyter:31046869
nb_pri_only:31057983
nativerepl1:31104042
refactort:31084545
pythonrstrctxt:31093868
flighttreat:31119334
wkspc-onlycs-t:31111718
nativeloc1:31118317
wkspc-ranged-t:31123313
cf971741:31111988
jh802675:31111929
e80f6927:31120813
ei213698:31121563
i21gd607:31121876

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Aug 25, 2024
@NoShotz
Copy link

NoShotz commented Aug 26, 2024

Seems some bots are posting malware on issues, found this issue after esttemanb did this on an issue I made on a completely different repo, I searched his name and found this issue.

@karthiknadig karthiknadig self-assigned this Aug 26, 2024
@karthiknadig
Copy link
Member

@eladsegal Apologies for delayed response on this. You should be adding ~/envs_dir not just envs_dir.
If that does not work. Let us know, and I will re-open the issue.

Please also include the Output from Output > Python Locator.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 1, 2024
@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2024
@eladsegal
Copy link
Author

Hi @karthiknadig, thank you for addressing this issue.

Regarding what should be set in python.venvFolders:

  • The description for python.venvFolders is "Folders in your home directory to look into for virtual environments (supports pyenv, direnv and virtualenvwrapper by default)."
  • In version 1.92.2 setting it to envs_dir does work, but setting it as ~/envs_dir doesn't. In the latest Insiders version, neither works.
  • In python.venvPath a full path is expected, as the description says "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).", but it doens't work as well.

I provided the output from Python Locator in the opening message of the issue.
Please let me know if there's something else I can do to provide more information.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

12 participants
@DonJayamanne @karthiknadig @NoShotz @eladsegal and others