poetry-shell
Activate project virtual environment shell
TLDR
SYNOPSIS
poetry shell [options]
DESCRIPTION
poetry shell spawns a new shell session with the project's virtual environment activated. All commands run within this shell will use the project's Python interpreter and installed packages.Type exit or press Ctrl+D to leave the virtual environment shell and return to the original session. The virtual environment is created automatically if it doesn't exist.
CAVEATS
Removed from Poetry core in Poetry 2.0 (January 2025). On Poetry 2.x the command is only available after installing the poetry-plugin-shell plugin (poetry self add poetry-plugin-shell). The officially recommended replacement is poetry env activate, which prints the shell-specific activation command rather than spawning a subshell — run it via eval (POSIX shells) or Invoke-Expression (PowerShell).Creates a new subshell as a child process; nested poetry shell invocations stack. Depending on your shell's configuration, rc files may be re-sourced on entry.
HISTORY
poetry shell provides interactive shell in Poetry virtual environment.
SEE ALSO
poetry(1), poetry-run(1)
