Skip to content

poetry add ... raising 'Key "name" does not exist.' when package-mode = false #9045

@armanjal

Description

@armanjal

Description

Hello,

Trying to use non-packaging mode by setting `package-mode = false` in pyproject.toml under `[tool.poetry]`. However, when running `poetry add ...` in the CLI, and error of `'Key "name" does not exist.'` pops up.

When using Poetry in package mode and adding the necessary fields under `[tool.poetry]`, such as `name` and `description`, the command works fine and the package is added under `[tool.poetry.dependencies]`.

Many thanks.

Workarounds

Manually adding the library into pyproject.toml.

Poetry Installation Method

install.python-poetry.org

Operating System

Mac 14.3.1

Poetry Version

1.8.1

Poetry Configuration

cache-dir = "/Users/USER/Library/Caches/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = false
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/USER/Library/Caches/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

`poetry add requests`
`'Key "name" does not exist.'`

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliRelated to the command linekind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions