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

gevent v 23.7.0 does not support PEP 517 #1971

Open
amirhessam88 opened this issue Jul 13, 2023 · 6 comments
Open

gevent v 23.7.0 does not support PEP 517 #1971

amirhessam88 opened this issue Jul 13, 2023 · 6 comments
Labels
Status: not gevent Environment or otherwise not a gevent issue. No further work expected. Type: Question User support and/or waiting for responses

Comments

@amirhessam88
Copy link

  • gevent version: PyPI via poetry
  • Python version: 3.9.16
  • Operating System: Mac x86_64

Description:

poetry update failed on • Updating gevent (22.10.2 -> 23.7.0): Failed

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

Please look at the detailed output for your error message (if it's hidden, you may have to ask for it). gevent most certainly does support PEP 517, so your problem is unrelated to that and was likely some other error on your system (for example, missing compilation headers or missing compilers).

It's curious that you'd even have to be building gevent though, as there are binary wheels for that platform on PyPI.

@jamadden jamadden added Status: not gevent Environment or otherwise not a gevent issue. No further work expected. Type: Question User support and/or waiting for responses labels Jul 13, 2023
@XYenon
Copy link

XYenon commented Aug 28, 2023

I got this error when install by pdm


ERRORS:
add gevent failed:
Traceback (most recent call last):
  File "/nix/store/xv07imkf2h5ryyk1xaa89fqdy4q84791-python3-3.10.12/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/synchronizers.py", line 277, in install_candidate
    self.manager.install(can)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/manager.py", line 33, in install
    installer(str(prepared.build()), self.environment, prepared.direct_url())
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/models/candidates.py", line 393, in build
    self.wheel = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/builders/wheel.py", line 25, in build
    self.install(self._requires, shared=True)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/builders/base.py", line 297, in install
    install_requirements(missing, env)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/core.py", line 27, in install_requirements
    syncer.synchronize()
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/synchronizers.py", line 248, in synchronize
    manager.install(can)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/manager.py", line 33, in install
    installer(str(prepared.build()), self.environment, prepared.direct_url())
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/installers.py", line 174, in install_wheel
    _install_wheel(wheel=wheel, destination=destination, additional_metadata=additional_metadata)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/installers.py", line 270, in _install_wheel
    install(source, destination, additional_metadata=additional_metadata or {})
  File "/nix/store/54l0kikykhzkbcpvcsx5s0h9lhxp8vf9-python3.10-installer-0.7.0/lib/python3.10/site-packages/installer/_core.py", line 109, in install
    record = destination.write_file(
  File "/nix/store/54l0kikykhzkbcpvcsx5s0h9lhxp8vf9-python3.10-installer-0.7.0/lib/python3.10/site-packages/installer/destinations.py", line 207, in write_file
    return self.write_to_fs(scheme, path_, stream, is_executable)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/installers.py", line 146, in write_to_fs
    return super().write_to_fs(scheme, path, stream, is_executable)
  File "/nix/store/54l0kikykhzkbcpvcsx5s0h9lhxp8vf9-python3.10-installer-0.7.0/lib/python3.10/site-packages/installer/destinations.py", line 173, in write_to_fs
    with open(target_path, "wb") as f:
PermissionError: [Errno 13] Permission denied: '/nix/store/xv07imkf2h5ryyk1xaa89fqdy4q84791-python3-3.10.12/include/python3.10/greenlet.h'

@XYenon
Copy link

XYenon commented Aug 28, 2023

It looks like pdm also use PEP 517.

unearth.preparer: Downloading <Link https://bytedpypi.byted.org/packages/pypi/gevent/gevent-23.7.0.tar.gz (from https://bytedpypi.byted.org/simple/gevent/)> (5.8 MB)
pdm.termui: Preparing isolated env for PEP 517 build...
pdm.termui: Saving wheel to cache: <Link https://bytedpypi.byted.org/packages/pypi/gevent/gevent-23.7.0.tar.gz (from https://bytedpypi.byted.org/simple/gevent/)>
pdm.termui: Running PEP 517 backend to build a wheel for <Link https://bytedpypi.byted.org/packages/pypi/gevent/gevent-23.7.0.tar.gz (from https://bytedpypi.byted.org/simple/gevent/)>
pdm.termui: ======== Start resolving requirements ========
pdm.termui:   greenlet>=3.0a1; platform_python_implementation == "CPython"
pdm.termui:   setuptools>=40.8.0
pdm.termui:   cffi>=1.12.3; platform_python_implementation == "CPython"
pdm.termui:   Cython>=3.0b3
pdm.termui:   python>=3.10.12,<3.10.13
pdm.termui:   Adding requirement greenlet>=3.0a1; platform_python_implementation == "CPython"
pdm.termui:   Adding requirement setuptools>=40.8.0
pdm.termui:   Adding requirement cffi>=1.12.3; platform_python_implementation == "CPython"
pdm.termui:   Adding requirement Cython>=3.0b3
pdm.termui:   Adding requirement python>=3.10.12,<3.10.13
pdm.termui: ======== Starting round 0 ========
pdm.termui: Pinning: python None
pdm.termui: ======== Ending round 0 ========
pdm.termui: ======== Starting round 1 ========
pdm.termui:   Adding requirement pycparser(from cffi 1.15.1)
pdm.termui: Pinning: cffi 1.15.1
pdm.termui: ======== Ending round 1 ========
pdm.termui: ======== Starting round 2 ========
pdm.termui: Pinning: Cython 3.0.2
pdm.termui: ======== Ending round 2 ========
pdm.termui: ======== Starting round 3 ========
pdm.termui: Pinning: greenlet 3.0.0a1
pdm.termui: ======== Ending round 3 ========
pdm.termui: ======== Starting round 4 ========
pdm.termui: Pinning: setuptools 68.1.2
pdm.termui: ======== Ending round 4 ========
pdm.termui: ======== Starting round 5 ========
pdm.termui: Pinning: pycparser 2.21
pdm.termui: ======== Ending round 5 ========
pdm.termui: ======== Starting round 6 ========
pdm.termui: ======== Resolution Result ========
pdm.termui: Stable pins:
pdm.termui:       python None
pdm.termui:         cffi 1.15.1
pdm.termui:       cython 3.0.2
pdm.termui:     greenlet 3.0.0a1
pdm.termui:   setuptools 68.1.2
pdm.termui:    pycparser 2.21
pdm.termui: Installing cffi@1.15.1...
unearth.preparer: Downloading <Link https://bytedpypi.byted.org/packages/pypi/cffi/cffi-1.15.1-cp310-cp310-macosx_10_9_x86_64.whl (from https://bytedpypi.byted.org/simple/cffi/)> (179 kB)
pdm.termui: Installing cython@3.0.2...
unearth.preparer: Downloading <Link https://bytedpypi.byted.org/packages/pypi/cython/Cython-3.0.2-cp310-cp310-macosx_10_9_x86_64.whl (from https://bytedpypi.byted.org/simple/cython/)> (3.1 MB)
pdm.termui: Installing greenlet@3.0.0a1...
unearth.preparer: Downloading <Link https://bytedpypi.byted.org/packages/pypi/greenlet/greenlet-3.0.0a1-cp310-cp310-macosx_11_0_x86_64.whl (from https://bytedpypi.byted.org/simple/greenlet/)> (238 kB)
  ✖ Install gevent 23.7.0 failed
pdm.termui: Error occurs:
Traceback (most recent call last):
  File "/nix/store/xv07imkf2h5ryyk1xaa89fqdy4q84791-python3-3.10.12/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/synchronizers.py", line 277, in install_candidate
    self.manager.install(can)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/manager.py", line 33, in install
    installer(str(prepared.build()), self.environment, prepared.direct_url())
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/models/candidates.py", line 393, in build
    self.wheel = Path(builder.build(build_dir, metadata_directory=self._metadata_dir))
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/builders/wheel.py", line 25, in build
    self.install(self._requires, shared=True)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/builders/base.py", line 297, in install
    install_requirements(missing, env)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/core.py", line 27, in install_requirements
    syncer.synchronize()
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/synchronizers.py", line 248, in synchronize
    manager.install(can)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/manager.py", line 33, in install
    installer(str(prepared.build()), self.environment, prepared.direct_url())
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/installers.py", line 174, in install_wheel
    _install_wheel(wheel=wheel, destination=destination, additional_metadata=additional_metadata)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/installers.py", line 270, in _install_wheel
    install(source, destination, additional_metadata=additional_metadata or {})
  File "/nix/store/54l0kikykhzkbcpvcsx5s0h9lhxp8vf9-python3.10-installer-0.7.0/lib/python3.10/site-packages/installer/_core.py", line 109, in install
    record = destination.write_file(
  File "/nix/store/54l0kikykhzkbcpvcsx5s0h9lhxp8vf9-python3.10-installer-0.7.0/lib/python3.10/site-packages/installer/destinations.py", line 207, in write_file
    return self.write_to_fs(scheme, path_, stream, is_executable)
  File "/nix/store/gilr0rh2g42axsc4wp980kyvnxdsy194-pdm-2.8.2/lib/python3.10/site-packages/pdm/installers/installers.py", line 146, in write_to_fs
    return super().write_to_fs(scheme, path, stream, is_executable)
  File "/nix/store/54l0kikykhzkbcpvcsx5s0h9lhxp8vf9-python3.10-installer-0.7.0/lib/python3.10/site-packages/installer/destinations.py", line 173, in write_to_fs
    with open(target_path, "wb") as f:
PermissionError: [Errno 13] Permission denied: '/nix/store/xv07imkf2h5ryyk1xaa89fqdy4q84791-python3-3.10.12/include/python3.10/greenlet.h'

@jamadden
Copy link
Member

gevent certainly supports PEP517 --- which says nothing about file permission errors, just the existence of a pyproject.toml file to provide information to the source build system. It's right there in the name: "A build-system independent format for source trees"

You're not using source trees. You downloaded binary --- pre-built --- wheels taking PEP 517 out of the question entirely. I will note that those binary wheels did not come directly from PyPI but from third-party service that I know nothing about, so I cannot vouch for their contents.

The tool(s) you are using apparently isn't setting up permissions correctly. Perhaps it has not been used to install packages that include C headers for other source packages to use? It's definitely something about your environment and tooling.

The file it's failing to write is the header that greenlet installs. greenlet does not do this itself, it uses the standard packaging metadata to say "here's a header you should make available to other C libraries"; it's up to the installation tooling to do the right thing with those files, whatever the right thing is. I'm guessing this tool doesn't do anything special with those and just puts them in what Python's sysconfig reports to be its include directory. But on your system, your include directory isn't writable (likely because it belongs to another nix-managed package). Most of the time, people deal with non-writable shared directories by using a virtual environment, but I don't know what to tell you about nix and the other tools

@XYenon
Copy link

XYenon commented Aug 29, 2023

I found it just use a wheel gevent-22.10.2-cp310-cp310-macosx_10_15_x86_64.whl on 22.10.2, but 23.7.0 does not have a -cp310-cp310-macosx_10_15_x86_64 wheel.

@PedroRegisPOAR
Copy link

I think I have found this problem too.

I was on a project that had mainly x86_64 people working on the project. Then, some day, the aarch64 machine gave me some error about not being able to build the wheel.

It is possible to check using pip if some package exists in cache, including the manylinux ones with the following commad (hardwired for gevent==23.9.0 and for --platform=manylinux2014_aarch64):

pip download gevent==23.9.0 --platform=manylinux2014_aarch64 --only-binary=:all: --python-version=3.9 --implementation=cp

Refs.:

It outputs:

ERROR: Could not find a version that satisfies the requirement gevent==23.9.0 (from versions: 20.12.0, 20.12.1, 21.1.0, 21.1.1, 21.1.2, 21.8.0, 21.12.0, 22.8.0, 22.10.1, 22.10.2)

For my use case it was possible to stick with "older" gevent version. It is possible to test if somewheel exists:

pip download gevent==22.10.2 --platform=manylinux2014_aarch64 --only-binary=:all: --python-version=3.9 --implementation=cp

Checking that the 22.10.2 exists for x86_64:

pip download gevent==22.10.2 --platform=manylinux2014_x86_64 --only-binary=:all: --python-version=3.9 --implementation=cp

In long term it would be really useful to have updated manylinux wheels published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: not gevent Environment or otherwise not a gevent issue. No further work expected. Type: Question User support and/or waiting for responses
Projects
None yet
Development

No branches or pull requests

4 participants