python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.72k stars 2.27k forks source link

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

Closed MycroftKang closed 1 year ago

MycroftKang commented 1 year ago

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.

dimbleby commented 1 year ago

you didn't provide any means to reproduce. installing docopt works fine for me.

If you can reproduce then this probably wants reporting to https://github.com/pypa/build/, that's what poetry 1.4.0's "modern installer" uses.

MycroftKang commented 1 year ago

@dimbleby It doesn't seem to be a problem specific to the docopt package. Installing timeout-decorator package fails in the following case:

Another case of this bug was reported in: https://github.com/requests-cache/requests-cache/issues/797

MycroftKang commented 1 year ago

From what I've seen so far, this bug doesn't occur when using Poetry 1.3.2.

dimbleby commented 1 year ago

sure, that's all consistent with it being a problem only with the "modern installer" in poetry 1.4.0: and if so then, as above, it likely wants reporting to https://github.com/pypa/build/

Samreay commented 1 year ago

For another case of this (if it helps reproduction), our pyproject.toml includes a dependency which installs pdpyras.

When running a poetry install, we receive:

ChefBuildError
  Backend 'setuptools.build_meta:__legacy__' is not available.
  at /usr/local/lib/python3.9/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 pdpyras (4.5.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "pdpyras (==4.5.2) ; python_version >= "3.5""'.

And I can confirm that if I run the command suggested, pdpyras installs perfectly fine.

image
jrversteegh commented 1 year ago

confirm for pluginbase-1.0.1. Works with poetry < 1.4.0, but not with poetry 1.4.0. Same error message.

radoering commented 1 year ago

I tried to reproduce this issue by putting all mentioned packages into one pyproject.toml:

docopt = "0.6.2"
pdpyras = "4.5.2"
timeout-decorator = "0.5.0"
pytest-clarity = "1.0.1"
pluginbase = "1.0.1"

While I have not been able to reproduce the error message mentioned in this issue, I encountered a different issue: pypa/virtualenv#2516

I don't expect it to be related to this issue, but since a new virtualenv version (20.21.0) with a fix was released yesterday, you may want to try to update virtualenv in your poetry installation and confirm that this issue is still present.

Note: The new virtualenv version cannot be used if poetry is installed with Python 3.9 on Windows, see https://github.com/python-poetry/poetry/blob/0e72a55c43a993ec0258facec23416c9212964ba/pyproject.toml#L80-L84

alexhermida commented 1 year ago

Same behaviour here with scikit-learn, with Poetry 1.3.2 works fine.

ElSaico commented 1 year ago

For those experiencing this issue: update your lock files. It might've been luck (intermittent failure and all...), but here it started to behave again.[1] That would explain the inability to reproduce this bug as well.

[1] ...and then immediately stumble into #7572, as I'm using Hypercorn, but that one is better understood and can be worked around without downgrading.

BEEugene commented 1 year ago

You can also try update pip, in my case it resolved the issue

MusicScience37 commented 1 year ago

For some libraries, change of the version of Python resolved errors.

aspcompiler commented 1 year ago

We encounter this sporadically with Poetry 1.4.1 running in Windows container as well. The error message is like:

 ā€¢ Installing wrapt (1.14.1)
  ChefBuildError
  Backend 'setuptools.build_meta:__legacy__' is not available.
  at ~\AppData\Roaming\pypoetry\venv\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 atomicwrites (1.4.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "atomicwrites (==1.4.1)"'.
alexjc commented 1 year ago

This happens quite often (not quite reliably) with Python 3.9 on windows, Poetry 1.4.1. Installing wcwidth as a dependency...

gpongelli commented 1 year ago

happened today with a package that has "bs4" as its dependency, when running windows with python 3.8 and 3.9, using poetry 1.4.1 due to recent poetry-core fix.

    ChefBuildError

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

    at ~\AppData\Local\Temp\cibw-run-fwneq3zj\cp38-win_amd64\venv-test\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 bs4 (0.0.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "bs4 (==0.0.1)"'.
Real-Gecko commented 1 year ago

MacOS Catalina, Python 3.10.11, Poetry 1.4.1

  ā€¢ Installing promise (2.3): Failed

  ChefBuildError

  Backend 'setuptools.build_meta:__legacy__' is not available.
radoering commented 1 year ago

To make sure this is not an issue that is fixed in the latest virtualenv version, please report the version of virtualenv in poetry's own environment in addition to the operating system and the Python version if you experience this issue!

I am not aware of any universally applicable way to determine the version. If installed poetry via pipx, it should be as easy as running:

pipx runpip poetry show virtualenv

Otherwise, you probably have to search for poetry's environment manually. If you think, you are in the correct environment, you can run the following snippet:

try:
    import poetry
except:
    print("I am not in the poetry environment and this is not the right answer")

import virtualenv
print(virtualenv.__version__)
thiagobenine commented 1 year ago

For those experiencing this issue: update your lock files. It might've been luck (intermittent failure and all...), but here it started to behave again.[1] That would explain the inability to reproduce this bug as well.

[1] ...and then immediately stumble into #7572, as I'm using Hypercorn, but that one is better understood and can be worked around without downgrading.

Updating the lock files solved for me, thanks @gpongelli!

ancalita commented 1 year ago

We've also noticed this in the CI on Windows jobs across python 3.8, 3.9, 3.10 after upgrading poetry to 1.4.2, updating lock file then running the CI (which includes running poetry install):

ChefBuildError

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

  at ~\AppData\Roaming\pypoetry\venv\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 fire (0.5.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "fire (==0.5.0)"'.

  ļæ½ Installing sanic-cors (2.0.1)
  ļæ½ Installing scipy (1.8.1)
  ļæ½ Installing tabulate (0.9.0)
  ļæ½ Installing tensorboard (2.11.2)
  ļæ½ Installing tensorflow-estimator (2.11.0)

  ChefBuildError

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

  at ~\AppData\Roaming\pypoetry\venv\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 future (0.18.3) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "future (==0.18.3)"'.

Confirming the lock file was updated after poetry upgrade with poetry lock --no-update and the issue occurs despite this.

dimbleby commented 1 year ago

https://github.com/python-poetry/poetry/issues/7611#issuecomment-1501539967

shyney7 commented 1 year ago

Same with poetry version 1.4.2 and trying to install pyperclip

Screenshot 2023-04-14 095144

dimbleby commented 1 year ago

https://github.com/python-poetry/poetry/issues/7611#issuecomment-1501539967

ancalita commented 1 year ago

@dimbleby I can't verify the version of virtualenv in the CI pipeline on Windows OS. However when I ran poetry self update 1.4.2 on my macOS machine, I noticed that virtualenv was downgraded from v20.16.5 to v20.16.4. Note that I was upgrading from poetry v1.2.2

gpongelli commented 1 year ago

those are two github action that shows the error: https://github.com/gpongelli/pycode128/actions/runs/4587661968/jobs/8101337292 and https://github.com/gpongelli/pycode128/actions/runs/4585602238/jobs/8097847571 .

The issue happens only on windows with python 3.9 , virtualenv-20.16.5 is installed by cibuildwheel and seems it's cached (I don't know how are cached python packages within github action's execution).

I've solved removing the dependent package that uses bs4 as its own dependency.

jouve commented 1 year ago
Updating dependencies
Resolving dependencies... (4.7s)

Package operations: 12 installs, 0 updates, 0 removals

  ā€¢ Installing flatdict (4.0.1): Failed

  ChefBuildError

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

  at /usr/local/Cellar/poetry/1.4.2/libexec/lib/python3.11/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 flatdict (4.0.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "flatdict (==4.0.1)"'.

but when I run pip wheel --use-pep517 "flatdict (==4.0.1)" , it works

CURL_CA_BUNDLE=~/work/cacert/cacert.pem poetry run pip wheel --use-pep517 "flatdict (==4.0.1)"
Collecting flatdict==4.0.1
  Using cached flatdict-4.0.1-py3-none-any.whl
Saved ./flatdict-4.0.1-py3-none-any.whl
earshinov commented 1 year ago

In our CI I now retry poetry install 3 times and it works.

RUN (poetry install -vvv --no-root || poetry install -vvv --no-root || poetry install -vvv --no-root)...
dimbleby commented 1 year ago

https://github.com/python-poetry/poetry/issues/7611#issuecomment-1501539967

Deuchnord commented 1 year ago

I have this issue too, only with Python 3.11 on Windows GitHub Actions workflow: https://github.com/Kosmorro/lib/actions/runs/4795432929/jobs/8529978278

dimbleby commented 1 year ago

https://github.com/python-poetry/poetry/issues/7611#issuecomment-1501539967

Deuchnord commented 1 year ago

The virtualenv package doesn't seem to be installed in my Poetry venvs. Am I supposed to add it?

dimbleby commented 1 year ago

the question isn't what version of virtualenv is used by the project under management, it is what version of virtualenv is being used by poetry itself.

The comment I linked gave clear instructions on how to answer that question, you have done something else altogether.

Deuchnord commented 1 year ago

Not sure to understand what I have to do: I have put the script you gave in a file and tried to run it (with and without poetry run), and locally (on macOS) I have this:

I am not in the poetry environment and this is not the right answer
Traceback (most recent call last):
  File "/Users/jerome/.../venv.py", line 6, in <module>
    import virtualenv
ModuleNotFoundError: No module named 'virtualenv'

I don't understand what I'm doing wrong here

Deuchnord commented 1 year ago

Fixed on my CI, for me the issue came from my pyproject.toml that still had the old tool.poetry.dev-dependencies section. After moving to the new tool.poetry.group.dev.dependencies style, the CI passed again.

MycroftKang commented 1 year ago

I have confirmed that this bug occurs in virtualenv version 20.16.5. (poetry 1.4.2)

$ pipx runpip poetry show virtualenv
Name: virtualenv
Version: 20.16.5
Summary: Virtual Python Environment builder
Home-page: https://virtualenv.pypa.io/
Author: Bernat Gabor
Author-email: gaborjbernat@gmail.com
License: MIT
Location: c:\program files (x86)\pipx\venvs\poetry\lib\site-packages
Requires: distlib, filelock, platformdirs
Required-by: poetry

However, since I don't know how to update virtualenv that poetry uses, I haven't tested it on the latest version of the virtualenv.

zxia-wish commented 1 year ago

Can confirm the problem with virtualenv 20.23.0 (latest at this time)

byt3bl33d3r commented 1 year ago

Seems to happen when installing the neo4j library as well. Python 3.11.3 , Poetry 1.5.1 & virtualenv 20.23.0:

vscode āžœ /workspaces/wat(main) $ poetry add neo4j
Using version ^5.9.0 for neo4j

Updating dependencies
Resolving dependencies... (0.2s)

Package operations: 1 install, 0 updates, 0 removals

  ā€¢ Installing neo4j (5.9.0): Failed

  ChefBuildError

  Backend 'setuptools.build_meta' is not available.

  at /usr/local/py-utils/venvs/poetry/lib/python3.11/site-packages/poetry/installation/chef.py:147 in _prepare
      143ā”‚ 
      144ā”‚                 error = ChefBuildError("\n\n".join(message_parts))
      145ā”‚ 
      146ā”‚             if error is not None:
    ā†’ 147ā”‚                 raise error from None
      148ā”‚ 
      149ā”‚             return path
      150ā”‚ 
      151ā”‚     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 neo4j (5.9.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "neo4j (==5.9.0)"'.
assuiedmilan commented 1 year ago

Still present in the current version. Hope this is a priority, downgrading my poetry version

Tommy-Dimitrio commented 1 year ago

For those experiencing this issue: update your lock files. It might've been luck (intermittent failure and all...), but here it started to behave again.[1] That would explain the inability to reproduce this bug as well.

[1] ...and then immediately stumble into #7572, as I'm using Hypercorn, but that one is better understood and can be worked around without downgrading.

Solved for me as well. Poetry 1.5.1 on WIndows 10

gschurck commented 1 year ago

I had the issue with the package pyrsistent version 0.18.1 and upgrading it to its latest version 0.19.3 fixed the issue for me.

amdokamal commented 1 year ago

Hope this helps someone out there. Stumbled upon a similar issue with Gitlab-CI runner (image: python:3.10.12-alpine3.18) even though everything was smooth working on Windows/Linux desktop setups. I followed the described "Interim Solutions", but alas... After digging I realized some dependencies were trying to build in the background, but were missing the essential tools for building. Once I added "apk add g++ musl-dev python3-dev" to the image, and everything was back to running as it should.

lucinvitae commented 1 year ago

I can confirm that my team hit this issue when attempting to upgrade to poetry 1.5.1; downgrading back to poetry 1.3.2 fixes the issue.

gaby commented 1 year ago

I'm running into the same error when using the windows-latest runner for Github Actions. The CI works fine for py3.10 and py3.11, but fails for py3.8, 3.9 with the same error:

ChefBuildError

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

  at C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\poetry\installation\chef.py:147 in _prepare
      143| 
      144|                 error = ChefBuildError("\n\n".join(message_parts))
      145| 
      146|             if error is not None:
    > 147|                 raise error from None
      148| 
      149|             return path
      150| 
      151|     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 olefile (0.46) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "olefile (==0.46)"'.

  ChefBuildError

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

  at C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\poetry\installation\chef.py:147 in _prepare
      143| 
      144|                 error = ChefBuildError("\n\n".join(message_parts))
      145| 
      146|             if error is not None:
    > 147|                 raise error from None
      148| 
      149|             return path
      150| 
      151|     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 compressed-rtf (1.0.6) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "compressed-rtf (==1.0.6)"'.

EDIT: Update pytest to latest version and now py3.8, 3.10, 3.11 fail with the same error but py3.9 passes...

nurbscoder commented 1 year ago

I have the same issue on a CI system using windows. On the system, I install poetry on the fly using pip (python -m pip install poetry). This was working fine for a long time. Suddenly, it stopped working and I got the same issue during poetry install, without changing anything (just restarting the CI job).

Investigating the difference took me to the point, that the failing job was using a newer version of virtualenv (20.24.0). By changing the poetry installation to `python -m pip install poetry virtualenv==20.23.1 it worked again.

So, it seams that the latest version of virtualenv is not compatible with poetry.

chiragkalal commented 1 year ago

I've encountered similar issue while installing websockets 8.1 with poetry 1.4.2

#0 28.26   ā€¢ Installing weasyprint (52.5)
#0 28.29   ā€¢ Installing websockets (8.1)
#0 29.43 
#0 29.43   ChefBuildError
#0 29.43 
#0 29.43   Backend 'setuptools.build_meta:__legacy__' is not available.
#0 29.43 
#0 29.43   at /usr/local/lib/python3.9/site-packages/poetry/installation/chef.py:152 in _prepare
#0 29.45       148ā”‚ 
#0 29.45       149ā”‚                 error = ChefBuildError("\n\n".join(message_parts))
#0 29.45       150ā”‚ 
#0 29.45       151ā”‚             if error is not None:
#0 29.45     ā†’ 152ā”‚                 raise error from None
#0 29.45       153ā”‚ 
#0 29.45       154ā”‚             return path
#0 29.45       155ā”‚ 
#0 29.45       156ā”‚     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
#0 29.45 
#0 29.45 Note: This error originates from the build backend, and is likely not a problem with poetry but with maxminddb (2.2.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "maxminddb (==2.2.0)"'.
#0 29.45 
#0 33.70 Warning: The file chosen for install of braintree 4.9.0 (braintree-4.9.0-py2.py3-none-any.whl) is yanked. Reason for being yanked: critical bugs
------
Dockerfile:29
--------------------
  27 |     
  28 |     WORKDIR /app
  29 | >>> RUN poetry install --no-dev --no-interaction --no-ansi
  30 |     
  31 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c poetry install --no-dev --no-interaction --no-ansi" did not complete successfully: exit code: 1
xaviernogueira commented 1 year ago

I have encountered the same issue with poetry==1.5.1, python 3.11, but only on "windows-latest" in my GitHub actions. Works fine on "ubuntu-latest".

I downgraded to poetry==1.3.2 which works now, but would love to be able to deploy on the latest versions. Devs please address!

nozwock commented 1 year ago

@xaviernogueira I'm having the exact issue on a 'windows-latest' action. Switching to poetry 1.3.2 worked for me. Updating lock file did nothing.

Investigamer commented 1 year ago

We had this same issue with packages htmlmin and csscompressor in the CI for Photoshop-Python-API . Running poetry upgrade and writing a new lock fixed one of them but not the other, then a different package popped the same issue so we were back to square one. Updating pip, setuptools, and wheel beforehand again did not fix the issue. Finally the issue was fixed using the above recommendation of using an older virtualenv: python -m pip install poetry virtualenv==20.23.1

But only for our Python 3.7 workflow, now it managed to get to 3.8 and now it is failing there :) More recommendations would surely be appreciated.

EDIT: Fixed after using repeat poetry install lines as suggested in original post. Very strange, hope this gets fixed for real eventually.

ddoan commented 1 year ago

We hit this with poetry 1.6.1 installing pandas 2.0.3.

20230824_21h02m27s_grim

Screenshot 2023-08-24 at 7 43 11 PM
pdobacz commented 1 year ago

Same issue running in github-actions with: windows-latest, poetry 1.6.1, virtualenv 20.24.4, python 3.10.11. Happens during installation of pybloom-live (4.0.0) or fire (0.5.0). Interestingly, it never failed for fire before pybloom-live was added, as if only the number of deps mattered.

Downgrading to 1.3.2 or repeating the poetry install command both work as workarounds.

KyleKing commented 1 year ago

I was having this issue in my GitHub Actions Windows CI Pipeline as well. Without downgrading poetry, I could workaround the missing backend by ensuring setuptools was installed in poetry's environment, but YMMV.

For a pipx install of poetry, this worked for me:

pipx install poetry==1.6.1
pipx inject poetry setuptools==68.1.2

And this should be a more general fix:

poetry self add setuptools
rez0n commented 1 year ago

Same issue.

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

Solved by downgrading to 1.3.2