Python setup
Here are the steps to set up python in VS Code with mise:
- Install the mise-vscode extension (if not already installed)
- Install the python extension for VS Code
- Open a project with a
mise.toml
file (or any other files supported by mise)
If your project contains a mise.toml
file, such as the one below:
mise-vscode
will automatically detect it and set python.defaultInterpreterPath
in your workspace settings.
If your mise.toml
file references a venv
like:
mise-vscode
will detect it and set your workspace settings to use the venv
as the default interpreter.
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.
- Open a python file
- In the status bar, click on the python interpreter version
- Select the correct interpreter from the list. The interpreter provided by
mise
should be the one provided bypython.defaultInterpreterPath
.