Poetry Flags & Options
Python dependency management and packaging.All Poetry pages
- poetry -C (--directory) and -P (--project): run Poetry for another folderpoetry -C DIR runs Poetry as if inside DIR; Poetry 2 -P DIR selects the project but keeps your working directory. Errors outside a project, CI and monorepos.
- poetry install --no-root: install dependencies without the project itselfpoetry install --no-root installs dependencies without the project and avoids No file/folder found for package. package-mode, --only-root, Docker layers.
- poetry install --only main: skip dev dependencies (replaces --no-dev)poetry install --only main skips dev and other groups and replaces the removed --no-dev. --without, --with, optional groups, poetry sync, production installs.
- poetry install -E (--extras): install optional dependenciespoetry install -E fast installs an optional extra from project.optional-dependencies; --all-extras installs all. Unknown extras, extras vs groups and pitfalls.