Skip to content

invalid python Interpreter for conda virtual environment #25650

@yjobic

Description

@yjobic

Behaviour

I've got the following message when selecting a python interpreter inside a conda env.

An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging. See output for more details regarding why the interpreter is invalid.

Steps to reproduce:

  1. Select Interpreter
  2. Choose the python interpreter inside a conda env

Diagnostic data

Version VSC windows, conda installer on WSL.
  • VSC 1.107.0 :
Version: 1.107.0 (user setup) Commit: 618725e67565b290ba4da6fe2d29f8fa1d4e3622 Date: 2025-12-10T07:43:47.883Z Electron: 39.2.3 ElectronBuildId: 12895514 Chromium: 142.0.7444.175 Node.js: 22.21.1 V8: 14.2.231.21-electron.0 OS: Windows_NT x64 10.0.26200
  • Python extension
Identifier ms-python.python Version 2025.20.0
  • settings.json :
    {
    "python.experiments.enabled": false,
    "python.terminal.activateEnvironment": true,
    "python.useEnvironmentsExtension ": false,
    "python.terminal.activateEnvInCurrentTerminal": true,
    "python.terminal.shellIntegration.enabled": false
    }

In the VSC terminal :

(base) yann@DESKTOP-GBCFM9K:~/ChangmtPhaseWindows/methode_diff_finie$ conda info

     active environment : base
    active env location : /home/yann/miniconda3
            shell level : 3
       user config file : /home/yann/.condarc
 populated config files : /home/yann/miniconda3/.condarc
                          /home/yann/miniconda3/condarc.d/anaconda-auth.yml
                          /home/yann/.condarc
          conda version : 25.11.0
    conda-build version : not installed
         python version : 3.13.11.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=skylake
                          __conda=25.11.0=0
                          __cuda=12.8=0
                          __glibc=2.39=0
                          __linux=6.6.87.2=0
                          __unix=0=0
       base environment : /home/yann/miniconda3  (writable)
      conda av data dir : /home/yann/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/yann/miniconda3/pkgs
                          /home/yann/.conda/pkgs
       envs directories : /home/yann/miniconda3/envs
                          /home/yann/.conda/envs
               platform : linux-64
             user-agent : conda/25.11.0 requests/2.32.5 CPython/3.13.11 Linux/6.6.87.2-microsoft-standard-WSL2 ubuntu/24.04.3 glibc/2.39 solver/libmamba conda-libmamba-solver/25.11.0 libmambapy/2.4.0 aau/0.7.5 c/. s/. e/.
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

I can change the conda env in the terminal :

(base) yann@DESKTOP-GBCFM9K:~/ChangmtPhaseWindows/methode_diff_finie$ conda activate phasechange
(phasechange) yann@DESKTOP-GBCFM9K:~/ChangmtPhaseWindows/methode_diff_finie$ 

I can use the python Interpreter:

(phasechange) yann@DESKTOP-GBCFM9K:~/ChangmtPhaseWindows/methode_diff_finie$ ~/miniconda3/envs/phasechange/bin/python -V
Python 3.14.2

The conda info are:

(phasechange) yann@DESKTOP-GBCFM9K:~/ChangmtPhaseWindows/methode_diff_finie$ ~/miniconda3/bin/conda info --json
{'platform': 'linux-64', 'conda_version': '25.11.0', 'conda_env_version': '25.11.0', 'conda_build_version': 'not installed', 'root_prefix': '/home/yann/miniconda3', 'conda_prefix': '/home/yann/miniconda3', 'av_data_dir': '/home/yann/miniconda3/etc/conda', 'av_metadata_url_base': None, 'root_writable': True, 'pkgs_dirs': ('/home/yann/miniconda3/pkgs', '/home/yann/.conda/pkgs'), 'envs_dirs': ('/home/yann/miniconda3/envs', '/home/yann/.conda/envs'), 'default_prefix': '/home/yann/miniconda3/envs/phasechange', 'active_prefix': '/home/yann/miniconda3/envs/phasechange', 'active_prefix_name': 'phasechange', 'conda_shlvl': 4, 'channels': ['https://conda.anaconda.org/conda-forge/linux-64', 'https://conda.anaconda.org/conda-forge/noarch', 'https://repo.anaconda.com/pkgs/main/linux-64', 'https://repo.anaconda.com/pkgs/main/noarch', 'https://repo.anaconda.com/pkgs/r/linux-64', 'https://repo.anaconda.com/pkgs/r/noarch'], 'user_rc_path': '/home/yann/.condarc', 'rc_path': '/home/yann/.condarc', 'sys_rc_path': '/home/yann/miniconda3/.condarc', 'offline': False, 'envs': ['/home/yann/miniconda3', '/home/yann/miniconda3/envs/fenicsx-env', '/home/yann/miniconda3/envs/phasechange'], 'python_version': '3.13.11.final.0', 'requests_version': '2.32.5', 'user_agent': 'conda/25.11.0 requests/2.32.5 CPython/3.13.11 Linux/6.6.87.2-microsoft-standard-WSL2 ubuntu/24.04.3 glibc/2.39 solver/libmamba conda-libmamba-solver/25.11.0 libmambapy/2.4.0 aau/0.7.5 c/_-bbeq4clMbwnt7rR0FWwD s/lOdYzI807_ecs8G6qPM0XZ e/rihRGyZ540k-mRDymkQTfi', 'conda_location': '/home/yann/miniconda3/lib/python3.13/site-packages/conda', 'config_files': (PosixPath('/home/yann/miniconda3/.condarc'), PosixPath('/home/yann/miniconda3/condarc.d/anaconda-auth.yml'), PosixPath('/home/yann/.condarc')), 'netrc_file': None, 'virtual_pkgs': [['__archspec', '1', 'skylake'], ['__conda', '25.11.0', '0'], ['__cuda', '12.8', '0'], ['__glibc', '2.39', '0'], ['__linux', '6.6.87.2', '0'], ['__unix', '0', '0']], 'solver': {'name': 'libmamba', 'user_agent': 'solver/libmamba conda-libmamba-solver/25.11.0 libmambapy/2.4.0', 'default': True}, 'UID': 1000, 'GID': 1000, 'sys.version': '3.13.11 | packaged by conda-forge | (main, Dec  6 2025, 11:24:03) [GCC 14.3.0]', 'sys.prefix': '/home/yann/miniconda3', 'sys.executable': '/home/yann/miniconda3/bin/python', 'site_dirs': [], 'env_vars': {'PATH': '/home/yann/.vscode-server/bin/618725e67565b290ba4da6fe2d29f8fa1d4e3622/bin/remote-cli:/home/yann/miniconda3/envs/phasechange/bin:/home/yann/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/WindowsApps/MicrosoftCorporationII.WindowsSubsystemForLinux_2.6.1.0_x64__8wekyb3d8bbwe:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files/Microsoft MPI/Bin:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/PuTTY:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0:/mnt/c/WINDOWS/System32/OpenSSH:/mnt/c/Program Files/dotnet:/mnt/c/Program Files/Git/cmd:/mnt/d/MATLAB/R2023b/runtime/win64:/mnt/d/MATLAB/R2023b/bin:/mnt/c/Program Files/Wolfram Research/WolframScript:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/mnt/d/Softs/LLNL/VisIt3.4.0:/mnt/c/Users/yann/AppData/Local/Microsoft/WindowsApps:/mnt/d/MiKTeX/miktex/bin/x64:/mnt/d/Softs/Microsoft VS Code/bin:/mnt/d/Qt/Tools/mingw810_64/bin:/snap/bin:/home/yann/.vscode-server/extensions/ms-python.debugpy-2025.16.0/bundled/scripts/noConfigScripts', 'BUNDLED_DEBUGPY_PATH': '/home/yann/.vscode-server/extensions/ms-python.debugpy-2025.16.0/bundled/libs/debugpy', 'CIO_TEST': '<not set>', 'CONDA_PROMPT_MODIFIER': '(phasechange) ', 'CONDA_PREFIX': '/home/yann/miniconda3/envs/phasechange', 'CONDA_PREFIX_3': '/home/yann/miniconda3', 'LD_PRELOAD': '<not set>', 'CONDA_SHLVL': '4', 'SSL_CERT_FILE': '<not set>', 'CURL_CA_BUNDLE': '<not set>', 'REQUESTS_CA_BUNDLE': '<not set>', 'CONDA_EXE': '/home/yann/miniconda3/bin/conda', 'CONDA_DEFAULT_ENV': 'phasechange', 'CONDA_ROOT': '/home/yann/miniconda3', 'CONDA_PREFIX_2': '/home/yann/miniconda3/envs/phasechange', 'CONDA_PREFIX_1': '/home/yann/miniconda3', 'CONDA_PYTHON_EXE': '/home/yann/miniconda3/bin/python'}, 'envs_details': {'/home/yann/miniconda3': {'name': 'base', 'created': None, 'last_modified': '2025-12-11T08:15:46.447826+00:00', 'active': False, 'base': True, 'frozen': False, 'writable': True}, '/home/yann/miniconda3/envs/fenicsx-env': {'name': 'fenicsx-env', 'created': None, 'last_modified': '2025-11-20T08:29:12.222127+00:00', 'active': False, 'base': False, 'frozen': False, 'writable': True}, '/home/yann/miniconda3/envs/phasechange': {'name': 'phasechange', 'created': None, 'last_modified': '2025-12-11T08:15:03.656585+00:00', 'active': True, 'base': False, 'frozen': False, 'writable': True}}}(phasechange) 

Output for Python in the Output

panel 2025-12-11 10:50:49.029 [info] Native locator: Refresh started
2025-12-11 10:50:49.029 [info] Native locator: Refresh started
2025-12-11 10:50:49.029 [info] Skipping ActivatedEnv Detection: process.env.VSCODE_CLI !== '1'
2025-12-11 10:50:49.033 [info] > pyenv which python
2025-12-11 10:50:49.034 [info] cwd: .
2025-12-11 10:50:49.180 [info] Conda environment manager found at: /home/yann/miniconda3/bin/conda
2025-12-11 10:50:49.180 [info] Using conda: /home/yann/miniconda3/bin/conda
2025-12-11 10:50:49.188 [info] > ~/miniconda3/bin/conda info --json
2025-12-11 10:50:50.833 [info] Native locator: Refresh finished in 2414 ms
2025-12-11 10:50:52.552 [info] Starting Pylance language server.
2025-12-11 10:51:00.684 [info] Native locator: Refresh started
2025-12-11 10:51:00.694 [info] Conda environment manager found at: /home/yann/miniconda3/bin/conda
2025-12-11 10:51:00.694 [info] Conda set to: /home/yann/miniconda3/bin/conda
2025-12-11 10:51:02.833 [info] Native locator: Refresh finished in 2149 ms
2025-12-11 10:52:47.133 [info] > ~/miniconda3/bin/conda info --json
2025-12-11 10:53:36.295 [info] Native locator: Refresh started
2025-12-11 10:53:36.301 [info] > ~/miniconda3/bin/conda info --json
2025-12-11 10:53:36.308 [info] Conda environment manager found at: /home/yann/miniconda3/bin/conda
2025-12-11 10:53:36.308 [info] Conda set to: /home/yann/miniconda3/bin/conda
2025-12-11 10:53:38.501 [info] Native locator: Refresh finished in 2205 ms
2025-12-11 10:55:06.381 [info] > ~/miniconda3/bin/conda info --json

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions