Skip to content

conda: Native locator can only find python interpreters for base environments #185

@CodeCatMeow

Description

@CodeCatMeow

Type: Bug

Behaviour

Native locator can't find the python interpreter for the conda virtual environment located in a custom path. In fact, it can only find the interpreter for the base virtual environment.

When I changed the Locator setting to the js option, the problem was solved.

Steps to reproduce:

  1. Locator uses the default settings (native) and can only find the base environment.

Image

  1. Locator uses the js option to find the conda virtual environment under a customized path.

Image

What's masked here represents my use of miniconda's non-default path to store other virtual environments. The output under the different options is provided below.

Diagnostic data

launch.json configuration

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Python: Current File",
			"type": "python",
			"request": "launch",
			"program": "${file}",
			"console": "integratedTerminal",
			"justMyCode": true
		}
	]
}

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

When using the Native option.

2025-01-29 19:31:51.366 [info] Native locator: Refresh started
2025-01-29 19:31:51.373 [info] Poetry environment manager found at: C:\Users\jiuyi\AppData\Roaming\pypoetry\venv\Scripts\poetry.exe
2025-01-29 19:31:51.392 [info] Conda environment manager found at: C:\ProgramData\miniconda3\Scripts\conda.exe
2025-01-29 19:31:51.580 [info] Native locator: Refresh finished in 215 ms

When using the js option.

2025-01-29 19:20:00.754 [info] Starting Environment refresh
2025-01-29 19:20:00.755 [info] Searching for windows registry interpreters
2025-01-29 19:20:00.755 [info] Searching windows known paths locator
2025-01-29 19:20:00.758 [info] Searching for pyenv environments
2025-01-29 19:20:00.758 [info] Searching for conda environments
2025-01-29 19:20:00.758 [info] Searching for global virtual environments
2025-01-29 19:20:00.758 [info] Searching for custom virtual environments
2025-01-29 19:20:00.758 [info] Finished searching for windows registry interpreters: 5 milliseconds
2025-01-29 19:20:00.758 [info] Searching for windows store envs
2025-01-29 19:20:00.766 [info] > C:\ProgramData\miniconda3\Scripts\conda.exe info --json
2025-01-29 19:20:00.798 [info] pyenv is not installed
2025-01-29 19:20:00.798 [info] Finished searching for pyenv environments: 42 milliseconds
2025-01-29 19:20:00.799 [info] Finished searching for custom virtual envs: 42 milliseconds
2025-01-29 19:20:00.799 [info] Finished searching for windows store envs: 41 milliseconds
2025-01-29 19:20:00.801 [info] Finished searching windows known paths locator: 48 milliseconds
2025-01-29 19:20:00.806 [info] Finished searching for global virtual envs: 49 milliseconds
2025-01-29 19:20:03.233 [info] Finished searching for conda environments: 2476 milliseconds
2025-01-29 19:20:03.254 [info] Environments refresh paths discovered (event): 2502 milliseconds
2025-01-29 19:20:03.254 [info] Environments refresh finished (event): 2502 milliseconds
2025-01-29 19:20:03.254 [info] Environments refresh paths discovered: 2502 milliseconds
2025-01-29 19:20:03.263 [info] Environment refresh took 2514 milliseconds

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

nothing

# Behaviour

Same as above.

Steps to reproduce:

Same as above.

Extension version: 2024.22.2
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Windows_NT x64 10.0.19045
Modes:

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityinfo-neededIssue requires more information from posterverifiedVerification succeeded

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions