Closed MycroftKang closed 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.
@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
From what I've seen so far, this bug doesn't occur when using Poetry 1.3.2.
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/
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.
confirm for pluginbase-1.0.1. Works with poetry < 1.4.0, but not with poetry 1.4.0. Same error message.
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
Same behaviour here with scikit-learn
, with Poetry 1.3.2 works fine.
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.
You can also try update pip, in my case it resolved the issue
For some libraries, change of the version of Python resolved errors.
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)"'.
This happens quite often (not quite reliably) with Python 3.9 on windows, Poetry 1.4.1. Installing wcwidth as a dependency...
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)"'.
MacOS Catalina, Python 3.10.11, Poetry 1.4.1
ā¢ Installing promise (2.3): Failed
ChefBuildError
Backend 'setuptools.build_meta:__legacy__' is not available.
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__)
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!
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.
Same with poetry version 1.4.2 and trying to install pyperclip
@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
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.
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
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)...
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
The virtualenv
package doesn't seem to be installed in my Poetry venvs.
Am I supposed to add it?
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.
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
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.
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
.
Can confirm the problem with virtualenv 20.23.0 (latest at this time)
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)"'.
Still present in the current version. Hope this is a priority, downgrading my poetry version
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
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.
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.
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.
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...
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.
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
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!
@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.
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.
We hit this with poetry 1.6.1 installing pandas 2.0.3.
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.
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
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
windows-2022
GitHub runner)-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.
View full logs
Interim Solutions
There are several workarounds below that mitigate this issue.
Downgrade poetry version to 1.3
Try
poetry install
several times