Resolving Poetry 'Additional properties are not allowed' Error
Problem Statement
When using Poetry for Python dependency management, you may encounter this error:
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 inpyproject.tomlwith obsolete Poetry - Installation conflicts or corrupted environments
Solution: Update Poetry to a Compatible Version
1. Verify Poetry Version
poetry --versionIf the version is below 1.2.0 (shown below), you need to upgrade:
Poetry (version 1.1.12) # ❌ OutdatedWARNING
Uninstalling Poetry improperly may remove configuration files. Backup ~/.poetry if you have custom settings.
2. Upgrade Poetry via Pip
pip install --upgrade poetry3. Alternative Installation Methods
If pip upgrade doesn't resolve the issue, try a clean install:
# 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# 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 terminal4. Resolve Environment Conflicts
If you're using Conda or virtual environments:
# Deactivate Conda environment
conda deactivate
# Ensure global poetry is used (not env-specific)
which poetry # Should return global path like ~/.local/bin/poetry5. Regenerate Lock File (After Upgrade)
# In your project directory
poetry lock --no-update
poetry install --no-rootHandling Related Issues
Case 1: "secondary = true" Property Error
If you encounter a similar error about secondary = true:
The Poetry configuration is invalid:
- data.source[0] must not contain {'secondary'} properties- Remove
secondary = truefrompyproject.toml - Delete
poetry.lock - Upgrade Poetry as shown above
- 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:
[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
pipxfor isolated, conflict-free installations - Remove
poetry.lockwhen migrating between major Poetry versions - Avoid manual root-level installs preventing proper updates
After upgrading, verify functionality:
poetry config --list # Checks configuration validation
poetry install # Tests dependency resolution