poetry
Manage Python packages and dependencies. Some subcommands such as
about,check,env, etc. have their own usage documentation. See also:asdf,pipenv,hatch. More information: https://python-poetry.org/docs/cli/.
- Create a new Poetry project in the directory with a specific name:
poetry new
- Install and add a dependency and its sub-dependencies to the
pyproject.tomlfile in the current directory:
poetry add
- Install the project dependencies using the
pyproject.tomlfile in the current directory:
poetry install
- Interactively (append
-nfor non-interactively) initialize the current directory as a new Poetry project:
poetry init
- Get the latest version of all dependencies and update
poetry.lock:
poetry update
- Execute a command inside the project's virtual environment:
poetry run
- Bump the version of the project in
pyproject.toml:
poetry version
- Spawn a shell within the project's virtual environment (for versions below 2.0, use
poetry shell):
eval "$(poetry env activate)"
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
