A blog about tech & coding

Use mise for installing Python and Node

By Marco on Tue Apr 07 20261 min read

Installing Python and Node is often straightforward, but when you have multiple projects on a single-machine that require different version of Python and Node, managing multiple version can be a hassle. To solve this issue, tools like nvm or pyenv exist that can make this easy for you.

These tools are not always straightforward to use though. Both tools have extension documentation just for setting it up, and automatically installing a Python or Node version defined by .python-version or .nvmrc also requires additional configuration in your shell configuration file.

Luckily, mise exists: mise is a tool version manager that can handle both automatic installation of Python and Node.

Setting up Mise for Python and Node

  1. Install mise according to the official docs: https://mise.jdx.dev. The following script is the easiest and officially supported:
    curl https://mise.run | sh
  2. After installation, follow the instructions to activate mise in your shell
  3. Now you can install Python and/or Node by using mise install -g python or mise install -g node
  4. Enable idiomatic version files (e.g. .python-version or .nvmrc). This is not enabled by default so you need to run the following commands:
    1. mise settings add idiomatic_version_file_enable_tools python
    2. mise settings add idiomatic_version_file_enable_tools node

Now when you run Python or Node in a directory with a version file, mise will automatically download the specified version before executing the command when it's not installed yet. Also it will automatically switch versions when switching a directory. Very nice!