Skip to content

Unable to select Python Interpreter #18231

@thisisjaymehta

Description

@thisisjaymehta

VS Code version

1.63.2

Extension version

v2021.12.1559732655

OS type

Windows

OS version

10 - Version 21H2 (OS Build 19044.1415)

Python distribution

Anaconda

Python version

3.10

Language server

Pylance

Expected behaviour

I created my environment using conda create --prefix E:\FastAPI\env\fastapi python=3.10

On Clicking "Select Interpreter" on bottom left of VS Code >> "+ Enter Interpreter Path..." >> Find a dialog box open where I can find and select my python.exe.

I select E:\FastAPI\env\fastapi\python.exe

VS Code should use that environment.

Actual behaviour

I created my environment using conda create --prefix E:\FastAPI\env\fastapi python=3.10

On Clicking "Select Interpreter" on bottom left of VS Code >> "+ Enter Interpreter Path..." >> Find a dialog box open where I can find and select my python.exe.

I select E:\FastAPI\env\fastapi\python.exe

But VC Code doesn't switch to that environment.

At bottom left of my screen, instead of showing that interpreter, it again shows "Select Python Interpreter" warning

Steps to reproduce

Create env : conda create --prefix E:\FastAPI\env\fastapi python=3.10
Select "E:\FastAPI\env\fastapi\python.exe" as interpreter
Interpreter not selected

Animation

Logs

Experiment 'pythonaacf' is active
Experiment 'pythonTensorboardExperiment' is active
Experiment 'pythonSurveyNotificationcf' is active
Experiment 'PythonPyTorchProfiler' is active
Experiment 'pythonDeprecatePythonPath' is active

C:\ProgramData\Anaconda3\Scripts\conda.exe info --json
~\AppData\Local\Programs\Python\Python310\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
e:\FastAPI\env\fastapi\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
C:\ProgramData\Anaconda3\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
E:\FastAPI\env\fastapi\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
E:\FastAPI\env\fastapi\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
Starting Pylance language server.
E:\FastAPI\env\fastapi\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
[ERROR 2022-0-2 18:20:17.349]: Diagnostic Code: InvalidPythonInterpreterDiagnostic, Message: No Python interpreter is selected. You need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.
Diagnostic Code: InvalidPythonInterpreterDiagnostic, Message: No Python interpreter is selected. You need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.
C:\ProgramData\Anaconda3\Scripts\conda.exe info --json
E:\FastAPI\env\fastapi\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
E:\FastAPI\env\fastapi\python.exe ~.vscode\extensions\ms-python.python-2021.12.1559732655\pythonFiles\interpreterInfo.py
C:\ProgramData\Anaconda3\Scripts\conda.exe info --json

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions