Poetry configuration is invalid - Additional properties are not allowed ('group' was unexpected)
Asked Answered
D

5

54

Recently, I faced this issue with Poetry. All my commands using poetry were failing with the following error.

RuntimeError

  The Poetry configuration is invalid:
    - Additional properties are not allowed ('group' was unexpected)
Denicedenie answered 28/9, 2022 at 5:59 Comment(2)
Check that you use the correct poetry virtual environment. Just had the same issue and deleting the .venv directory and running poetry install again resolved the problem.Neddy
poetry seems to break backwards compatibilty every other version, I would steer clear of it.Strickle
D
61

I figured out the following issue.

  1. The code owners had updated the poetry core requirement to requires = ["poetry-core>=1.2.0"]
  2. My current poetry version was 1.1.12

I did the following to fix my issue.

# remove the current poetry installation
rm -rf /Users/myusername/.poetry

# upgrade poetry version
pip install poetry -U

This should solve the problem. I verified the same by running my other poetry commands.

It should be noted that your current poetry configurations will be lost while doing this, and would need to be recreated and reinstalled.

# reinstall poetry for my project
poetry install
Denicedenie answered 28/9, 2022 at 5:59 Comment(1)
On Ubuntu 22.04, I had installed poetry using apt, so I issued the command apt remove python3-poetry to remove poetry, then I installed it using the command pip install poetry -U. The instructions at python-poetry.org/blog/announcing-poetry-1.2.0 did not work for me.Roundish
I
16

This is because you're working on a repo that uses the new version of Poetry, >=1.2.0 and you may have the old poetry installed locally.

The new version of pyproject.toml file supports dependency groups such as the following example

[tool.poetry.group.new_group]
optional = true

[tool.poetry.group.new_group.dependencies]
tensorflow = "*"

The solution is to update your version of Poetry using the instructions in the poetry docs.

Inclement answered 1/11, 2022 at 23:2 Comment(1)
Command in reference from the poetry docs. poetry self updateFaucher
C
1

For me just doing conda decativate worked. It turns out that i was by default in a "base" enviroment with the wrong installation of poetry

Colewort answered 20/2, 2024 at 15:51 Comment(0)
A
1

Faced the same issue on Ubuntu 22 (WSL).

➡️ I could get latest poetry version (1.8.3) installed through pipx, by following the official procedures:

  1. pipx installation
  • sudo apt update
  • sudo apt -y install pipx
  • pipx ensurepath
  1. poetry installation
  • pipx install poetry

Result:

    >poetry --version
    Poetry (version 1.8.3)
Areopagite answered 24/5, 2024 at 12:37 Comment(0)
B
0

I had this error so I:

  • uninstalled the poetry file from my bin folder
  • I left root and reinstalled poetry using the installer on the website

It worked for me, root somehow messed it up.

Bigot answered 3/4, 2024 at 16:15 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.