Skip to content

Resolving Poetry 'Additional properties are not allowed' Error


Problem Statement

When using Poetry for Python dependency management, you may encounter this error:

bash
RuntimeError

  The Poetry configuration is invalid:
    - Additional properties are not allowed ('group' was unexpected)

This occurs when your Poetry project uses modern configuration features (like dependency groups introduced in Poetry 1.2.0), but your local Poetry installation is outdated and doesn't recognize these new properties. The mismatch between the project configuration and Poetry version causes validation failures.

Common triggers:

  • Project requires Poetry ≥1.2.0 while local version is older (e.g., 1.1.x)
  • Attempting to use new [tool.poetry.group] syntax in pyproject.toml with obsolete Poetry
  • Installation conflicts or corrupted environments

Solution: Update Poetry to a Compatible Version

1. Verify Poetry Version

bash
poetry --version

If the version is below 1.2.0 (shown below), you need to upgrade:

Poetry (version 1.1.12)  # ❌ Outdated

WARNING

Uninstalling Poetry improperly may remove configuration files. Backup ~/.poetry if you have custom settings.

2. Upgrade Poetry via Pip

bash
pip install --upgrade poetry

3. Alternative Installation Methods

If pip upgrade doesn't resolve the issue, try a clean install:

sh
# Install pipx if missing
python -m pip install --user pipx
python -m pipx ensurepath

# Install Poetry via pipx
pipx install poetry

# Validate version
poetry --version
sh
# Remove existing installation (Unix/macOS)
rm -rf ~/.poetry

# Reinstall via recommended script
curl -sSL https://install.python-poetry.org | python3 -

# Reset shell
source ~/.bashrc  # or restart terminal

4. Resolve Environment Conflicts

If you're using Conda or virtual environments:

bash
# Deactivate Conda environment
conda deactivate

# Ensure global poetry is used (not env-specific)
which poetry  # Should return global path like ~/.local/bin/poetry

5. Regenerate Lock File (After Upgrade)

bash
# In your project directory
poetry lock --no-update
poetry install --no-root

Case 1: "secondary = true" Property Error

If you encounter a similar error about secondary = true:

bash
The Poetry configuration is invalid:
   - data.source[0] must not contain {'secondary'} properties
  1. Remove secondary = true from pyproject.toml
  2. Delete poetry.lock
  3. Upgrade Poetry as shown above
  4. Rerun poetry install

Why This Happens

Poetry 1.2.0 introduced new configuration structures:

  • Dependency groups: Allow segmenting dependencies by environment
  • Modern TOML schema: Replaced deprecated syntax like secondary

New pyproject.toml Syntax:

toml
[tool.poetry.group.dev.dependencies]  # ✅ Valid in ≥1.2.0
pytest = "^7.0"

Older Poetry versions (<1.2.0) can't parse these sections, throwing validation errors due to unrecognized keywords like group.


Key Takeaways

  • Always match Poetry versions across development environments
  • Upgrade using pipx for isolated, conflict-free installations
  • Remove poetry.lock when migrating between major Poetry versions
  • Avoid manual root-level installs preventing proper updates

After upgrading, verify functionality:

bash
poetry config --list  # Checks configuration validation
poetry install         # Tests dependency resolution