Skip to content

Installing a package that depends on setuptools fails intermittently: Backend 'setuptools.build_meta:__legacy__' is not available. #7611

@MycroftKang

Description

@MycroftKang
  • Poetry version: 1.4.0
  • Python version: 3.10.9
  • OS version and name: Microsoft Windows Server 2022 10.0.20348 Datacenter (windows-2022 GitHub runner)
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Installing a package that depends on setuptools fails intermittently. This bug does not occur in poetry 1.3 and is found in poetry 1.4.

ChefBuildError

  Backend 'setuptools.build_meta:__legacy__' is not available.

  at C:\Program Files (x86)\pipx\venvs\poetry\lib\site-packages\poetry\installation\chef.py:152 in _prepare
      148| 
      149|                 error = ChefBuildError("\n\n".join(message_parts))
      150| 
      151|             if error is not None:
    > 152|                 raise error from None
      153| 
      154|             return path
      155| 
      156|     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with docopt (0.6.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "docopt (==0.6.2)"'.
View full logs

    $ poetry install
    Installing dependencies from lock file
Package operations: 150 installs, 2 updates, 0 removals

    Installing certifi (2022.12.7)
    Installing charset-normalizer (2.0.12)
    Installing idna (3.4)
    Installing pyasn1 (0.4.8)
    Installing urllib3 (1.26.14)
    Installing cachetools (5.3.0)
    Installing oauthlib (3.2.2)
    Installing pyasn1-modules (0.2.8)
    Installing requests (2.28.2)
    Installing six (1.16.0)
    Installing rsa (4.9)
    Installing catalogue (2.0.8)
    Installing colorama (0.4.6)
    Installing google-auth (2.16.0)
    Installing markupsafe (2.1.2)
    Installing requests-oauthlib (1.3.1)
    Installing multidict (5.2.0)
    Installing typing-extensions (4.4.0)
    Installing tzdata (2022.7)
    Installing absl-py (1.3.0)
    Installing click (8.1.3)
    Installing cymem (2.0.7)
    Installing frozenlist (1.3.3)
    Installing grpcio (1.51.1)
    Installing google-auth-oauthlib (0.4.6)
    Installing locket (1.0.0)
    Installing markdown (3.4.1)
    Installing murmurhash (1.0.9)
    Installing numpy (1.23.5)
    Installing pamqp (3.2.1)
    Installing protobuf (3.19.6)
    Installing pydantic (1.10.4)
    Installing pyparsing (3.0.9)
    Installing pyreadline3 (3.4.1)
    Installing pytz-deprecation-shim (0.1.0.post0)
    Installing ruamel-yaml-clib (0.2.7)
    Updating setuptools (65.3.0 -> 66.1.1)
    Installing srsly (2.4.5)
    Installing tensorboard-data-server (0.6.1)
    Installing tensorboard-plugin-wit (1.8.1)
    Installing termcolor (2.2.0)
    Installing toolz (0.12.0)
    Installing werkzeug (2.2.2)
    Updating wheel (0.37.1 -> 0.38.4)
    Installing yarl (1.8.2)
    Installing aiormq (6.6.4)
    Installing aiosignal (1.3.1)
    Installing astunparse (1.6.3)
    Installing async-timeout (4.0.2)
    Installing attrs (22.1.0)
    Installing blis (0.7.9)
    Installing cloudpickle (2.2.1)
    Installing confection (0.0.4)
    Installing docopt (0.6.2)
    Installing fire (0.5.0)
    Installing flatbuffers (23.1.21)
    Installing fsspec (2023.1.0)
    Installing gast (0.5.3)
    Installing google-pasta (0.2.0)
    Installing greenlet (2.0.1)
    Installing h5py (3.8.0)
    Installing humanfriendly (10.0)
    Installing joblib (1.2.0)
    Installing keras (2.8.0)
    Installing keras-preprocessing (1.1.2)
    Installing libclang (15.0.6.1)
    Installing msgpack (1.0.4)
    Installing opt-einsum (3.3.0)
    Installing packaging (20.9)
    Installing partd (1.3.0)
    Installing preshed (3.0.8)
    Installing pyrsistent (0.19.3)
    Installing python-crfsuite (0.9.9)
    Installing python-dateutil (2.8.2)
    Installing pytz (2022.1)
    Installing pyyaml (6.0)
    Installing ruamel-yaml (0.17.21)
    Installing scipy (1.8.1)
    Installing smart-open (6.3.0)
    Installing tabulate (0.9.0)
    Installing tensorboard (2.8.0)
    Installing tensorflow-estimator (2.8.0)
    Installing tensorflow-io-gcs-filesystem (0.30.0)
    Installing threadpoolctl (3.1.0)
    Installing tqdm (4.64.1)
    Installing typeguard (2.13.3)
    Installing typer (0.7.0)
    Installing tzlocal (4.2)
    Installing wasabi (0.10.1)
    Installing wrapt (1.14.1)

  ChefBuildError

  Backend 'setuptools.build_meta:__legacy__' is not available.

  at C:\Program Files (x86)\pipx\venvs\poetry\lib\site-packages\poetry\installation\chef.py:152 in _prepare
      148| 
      149|                 error = ChefBuildError("\n\n".join(message_parts))
      150| 
      151|             if error is not None:
    > 152|                 raise error from None
      153| 
      154|             return path
      155| 
      156|     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with docopt (0.6.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "docopt (==0.6.2)"'.

Interim Solutions

There are several workarounds below that mitigate this issue.

  • Downgrade poetry version to 1.3
pipx install "poetry>=1.3.0,<1.4.0"
  • Try poetry install several times
poetry install -vvv --no-root || poetry install -vvv --no-root || poetry install -vvv --no-root...

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installerRelated to the dependency installerkind/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