Skip to content

Python setup

Here are the steps to set up python in VS Code with mise:

  1. Install the mise-vscode extension (if not already installed)
  2. Install the python extension for VS Code
  3. Open a project with a mise.toml file (or any other files supported by mise)

pyton setup

If your project contains a mise.toml file, such as the one below:

[tools]
python = "3.13"

mise-vscode will automatically detect it and set python.defaultInterpreterPath in your workspace settings.

If your mise.toml file references a venv like:

[tools]
python = 'latest'
[env]
_.python.venv = { create = true, path = '.venv' }

mise-vscode will detect it and set your workspace settings to use the venv as the default interpreter.

{
"python.defaultInterpreterPath": "${workspaceFolder}/.venv"
}

The VSCode python extension does not use the python.defaultInterpreterPath setting if an interpret was previously set (see this document for more details.

For this reason, you might need to manually switch the python interpreter if the wrong one was selected by the python extension.

  1. Open a python file
  2. In the status bar, click on the python interpreter version
  3. Select the correct interpreter from the list. The interpreter provided by mise should be the one provided by python.defaultInterpreterPath.

python-select-interpreter