Setting Up Python on macOS with mise
An alternative approach using mise - a polyglot version manager that handles Python, Node.js, and 50+ other tools.
Why mise?
- One tool replaces pyenv, nvm, rbenv, etc.
- Fast - written in Rust
- Simple config - single
.mise.tomlfile per project - Backwards compatible - reads
.python-version,.nvmrc, etc.
Prerequisites
- macOS with Homebrew installed
- zsh (default on modern macOS)
Step 1: Install mise
Step 2: Configure Your Shell
Add to ~/.zshrc:
eval "$(mise activate zsh)"
Restart your terminal or run:
Step 3: Install Python
# See available versions mise ls-remote python # Install and set as global default mise use --global python@3.11 # Or install a specific patch version mise use --global python@3.11.11
Step 4: Install Poetry
curl -sSL https://install.python-poetry.org | python3 -Add to your PATH in ~/.zshrc:
export PATH="$HOME/.local/bin:$PATH"
Step 5: Install pipx (Optional)
For global CLI tools:
brew install pipx pipx ensurepath
Per-Project Configuration
Create .mise.toml in your project root:
Or for multiple tools:
[tools] python = "3.11" node = "20" [env] PYTHONDONTWRITEBYTECODE = "1"
mise automatically activates when you cd into the directory.
Common Commands
# List installed versions mise list # Install a specific version mise install python@3.12.9 # Set global default mise use --global python@3.11 # Set project-local version (creates .mise.toml) mise use python@3.12 # See what's active mise current # Upgrade mise itself mise self-update
Migrating from pyenv
mise reads .python-version files, so existing projects work immediately.
To fully migrate:
- Install mise
- Install your Python versions via mise
- Remove pyenv from your shell config
- (Optional) Delete
~/.pyenv
Verification
# mise is managing Python which python # Should show: ~/.local/share/mise/installs/python/3.11.11/bin/python # Correct version python --version # See all managed tools mise list
Project Workflow
New Project
mkdir my-project && cd my-project mise use python@3.11 poetry init poetry add requests
Existing Project
cd existing-project mise install # Installs versions from .mise.toml or .python-version poetry install
Comparison: mise vs pyenv
| Feature | mise | pyenv |
|---|---|---|
| Python versions | ✓ | ✓ |
| Node.js, Ruby, Go, etc. | ✓ | ✗ |
| Speed | Faster (Rust) | Slower (shell) |
| Config file | .mise.toml |
.python-version |
| Env variables | Built-in | Needs direnv |
| Learning curve | Low | Low |
Summary
| Task | Tool |
|---|---|
| Install/manage Python (and other runtimes) | mise |
| Project dependencies | Poetry |
| Global CLI tools | pipx |
mise simplifies your setup by consolidating version management into a single, fast tool.