Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "The Poetry configuration is invalid: project must contain ['name'] properties" when installing label-studio-ml-backend #6851

Closed
AnggaDS01 opened this issue Jan 6, 2025 · 3 comments

Comments

@AnggaDS01
Copy link

Describe the bug
I encountered an error while trying to install label-studio-ml-backend using pip install -e .. The installation fails due to a dependency issue with label-studio-sdk, where the Poetry configuration in pyproject.toml seems to be invalid. This error prevents me from proceeding with creating a custom ML backend using the label-studio-ml create my_ml_backend command.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the label-studio-ml-backend repository:
git clone https://github.com/HumanSignal/label-studio-ml-backend.git
cd label-studio-ml-backend
  1. Run the installation command:
pip install -e .
  1. The installation fails with the following error:
(label_studio) anggads_01@DESKTOP-O2G4H9A:~/Workspace/Label_Studio/label-studio-ml-backend$ pip install -e .
Obtaining file:///home/anggads_01/Workspace/Label_Studio/label-studio-ml-backend
  Preparing metadata (setup.py) ... done
Collecting label-studio-sdk@ git+https://github.com/HumanSignal/label-studio-sdk.git (from label-studio-ml==2.0.1.dev0)
  Cloning https://github.com/HumanSignal/label-studio-sdk.git to /tmp/pip-install-36mai0aw/label-studio-sdk_8fbbfcce2dba4318bea85860eec6795f
  Running command git clone --filter=blob:none --quiet https://github.com/HumanSignal/label-studio-sdk.git /tmp/pip-install-36mai0aw/label-studio-sdk_8fbbfcce2dba4318bea85860eec6795f
  Resolved https://github.com/HumanSignal/label-studio-sdk.git to commit 3ea3e9b7582d483419007e608b79662c1ef9b948
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      Traceback (most recent call last):
        File "/home/anggads_01/miniconda3/envs/label_studio/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/anggads_01/miniconda3/envs/label_studio/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/anggads_01/miniconda3/envs/label_studio/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-gq8_lkss/overlay/lib/python3.9/site-packages/poetry/core/masonry/api.py", line 42, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path().resolve(), with_groups=False)
        File "/tmp/pip-build-env-gq8_lkss/overlay/lib/python3.9/site-packages/poetry/core/factory.py", line 58, in create_poetry
          raise RuntimeError("The Poetry configuration is invalid:\n" + message)
      RuntimeError: The Poetry configuration is invalid:
        - project must contain ['name'] properties
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

Expected behavior
The installation should succeed, allowing me to proceed with creating a custom ML backend using:

label-studio-ml create my_ml_backend

Screenshots
image

Environment:

  • OS: Ubuntu 24.04 (using WSL2)
  • Label Studio Version 1.15.0
  • Python Version: 3.9.7 (Miniconda)
  • Pip Version: 24.2

Additional context
This issue is likely caused by the pyproject.toml file in the label-studio-sdk repository missing the required name property under [tool.poetry]. Without this property, Poetry cannot generate metadata, leading to the error.

@jombooth
Copy link
Contributor

jombooth commented Jan 6, 2025

Hi @AnggaDS01 - thanks for raising! This issue seems to be caused by a breaking change in the latest version of poetry-core and we are working on a fix.

@jombooth
Copy link
Contributor

jombooth commented Jan 6, 2025

This should be fixed now (in HumanSignal/label-studio-sdk#382)

@jombooth jombooth closed this as completed Jan 6, 2025
legau pushed a commit to socotecio/django-socio-grpc that referenced this issue Jan 6, 2025
# Remove the platform parameter from Dockerfile
We should remove the fixed `--platform=linux/amd64` from Dockefile to
allow docker to choose right architecture when pulling the image.

If this change affects the github action, we should specify the platform
parameter on github action task

# Fix poetry version issue
When I try to build the image using `docker compose build` today, it
failed due to a breaking change of poetry 2.0.0.

We need to put a constrain of 'poetry<2.0.0' for now.

```
docker compose build

> [django-socio-grpc server 1/1] RUN poetry install:
0.493
0.502 The Poetry configuration is invalid:
0.502   - project must contain ['name'] properties
```

Others are experiencing [the same
issue](HumanSignal/label-studio#6851)

Co-authored-by: Randall Wang <randall@talpa-solutions.com>
@holdenweb
Copy link

Was this regarded as fixed on 2.0.1, or do I need to wait for a further release?

The really weird thing for me is that the project builds fine until I add

[project.scripts]
tagsetdemo = "tagset.demo:main"

to my pyproject.toml, whereupon I see the same error already reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants