mise/Python/How To/Use mise to set up a virtualenv with poetry
Properties
- tags
- CLI/Tool, Diataxis/How To
How To Use Mise with Poetry
Goal
Preconditions
Procedure
1. Pin Python
2. Install the latest Poetry via Mise
3. Tell Mise to create & re-use
.venv4. Scaffold (or adopt) the Poetry project
5. Encode common commands as Mise tasks
- Append a
[tasks]section so teammates can typemise run setupinstead of remembering Poetry flags:toml[tasks] setup = "poetry install" # lock & install deps into .venv poetry = { run = "poetry {{@}}", desc = "Pass-through to Poetry" } test = { run = "poetry run pytest", sources = ["src/**/*", "tests/**/*"] } - List tasks with
mise tasks; run withmise run <task>.
- Append a
6. First-time install
7. Daily usage
Troubleshooting
References