LinuxCommandLibrary

poetry-env

Manage Poetry virtual environments

TLDR

List environments

$ poetry env list
copy
Show environment info
$ poetry env info
copy
Use specific Python
$ poetry env use [python3.11]
copy
Remove environment
$ poetry env remove [python3.11]
copy
Show environment path
$ poetry env info --path
copy

SYNOPSIS

poetry env command [options]

DESCRIPTION

poetry env manages virtual environments for Poetry projects. It can create, list, and remove environments, as well as switch between Python versions.

PARAMETERS

--path

Show only environment path.
--executable
Show only Python executable.

EXAMPLES

$ # Show current environment
poetry env info

# Get environment path
poetry env info --path

# List all environments
poetry env list

# Switch to Python 3.11
poetry env use python3.11

# Use specific path
poetry env use /usr/bin/python3.10

# Remove environment
poetry env remove python3.9

# Remove all environments
poetry env remove --all
copy

COMMANDS

info

Show environment information.
list
List all environments.
use python
Activate Python version.
remove envs
Remove environments.

ENVIRONMENT LOCATION

By default, environments are in:

$ ~/.cache/pypoetry/virtualenvs/
copy
Or project-local with:
$ poetry config virtualenvs.in-project true
copy

CAVEATS

Python version must be installed separately. Poetry manages environments, not Python installations.

HISTORY

poetry env is part of Poetry by Sébastien Eustace, providing virtual environment management for Python projects.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community