Installing `greenlet` failed
Hello!
I wanted to try this project, but failed to install dependencies, unfortunately!
poetry install
Installing dependencies from lock file
Package operations: 31 installs, 3 updates, 0 removals
- Downgrading idna (3.7 -> 3.4)
- Installing sniffio (1.3.0)
- Installing anyio (3.6.2)
- Installing attrs (22.2.0)
- Downgrading certifi (2024.2.2 -> 2022.12.7)
- Installing h11 (0.14.0)
- Installing iniconfig (2.0.0)
- Installing markupsafe (2.1.2)
- Downgrading packaging (24.0 -> 23.0)
- Installing pluggy (1.0.0)
- Installing psutil (5.9.4)
- Installing typing-extensions (4.5.0)
- Installing click (8.1.3)
- Installing greenlet (2.0.2): Failed
ChefBuildError
Backend subprocess exited when trying to invoke build_wheel
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-312
creating build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
creating build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
creating build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_version.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_weakref.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_gc.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/leakcheck.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_generator.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_greenlet_trash.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_throw.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_tracing.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_cpp.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_contextvars.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_greenlet.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_extension_interface.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/__init__.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_generator_nested.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_stack_saved.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/test_leaks.py -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
running egg_info
writing src/greenlet.egg-info/PKG-INFO
writing dependency_links to src/greenlet.egg-info/dependency_links.txt
writing requirements to src/greenlet.egg-info/requires.txt
writing top-level names to src/greenlet.egg-info/top_level.txt
reading manifest file 'src/greenlet.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'benchmarks/*.json'
no previously-included directories found matching 'docs/_build'
warning: no files found matching '*.py' under directory 'appveyor'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '.coverage' found anywhere in distribution
adding license file 'LICENSE'
adding license file 'LICENSE.PSF'
adding license file 'AUTHORS'
writing manifest file 'src/greenlet.egg-info/SOURCES.txt'
copying src/greenlet/greenlet.cpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_allocator.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_compiler_compat.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_cpython_compat.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_exceptions.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_greenlet.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_internal.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_refs.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_slp_switch.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_thread_state.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_thread_state_dict_cleanup.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/greenlet_thread_support.hpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/slp_platformselect.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet
copying src/greenlet/platform/setup_switch_x64_masm.cmd -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_aarch64_gcc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_alpha_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_amd64_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_arm32_gcc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_arm32_ios.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_arm64_masm.asm -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_arm64_masm.obj -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_arm64_msvc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_csky_gcc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_m68k_gcc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_mips_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_ppc64_aix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_ppc64_linux.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_ppc_aix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_ppc_linux.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_ppc_macosx.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_ppc_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_riscv_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_s390_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_sparc_sun_gcc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_x32_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_x64_masm.asm -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_x64_masm.obj -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_x64_msvc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_x86_msvc.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/platform/switch_x86_unix.h -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/platform
copying src/greenlet/tests/_test_extension.c -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
copying src/greenlet/tests/_test_extension_cpp.cpp -> build/lib.macosx-10.9-universal2-cpython-312/greenlet/tests
running build_ext
building 'greenlet._greenlet' extension
creating build/temp.macosx-10.9-universal2-cpython-312
creating build/temp.macosx-10.9-universal2-cpython-312/src
creating build/temp.macosx-10.9-universal2-cpython-312/src/greenlet
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -arch arm64 -arch x86_64 -g -I/private/var/folders/l8/nb0g557571j3_37lb2_c1hnw0000gn/T/tmp_d8v6b1t/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c src/greenlet/greenlet.cpp -o build/temp.macosx-10.9-universal2-cpython-312/src/greenlet/greenlet.o --std=gnu++11
In file included from src/greenlet/greenlet.cpp:19:
In file included from src/greenlet/greenlet_internal.hpp:20:
src/greenlet/greenlet_greenlet.hpp:831:41: error: no member named 'use_tracing' in '_PyCFrame'
this->use_tracing = tstate->cframe->use_tracing;
~~~~~~~~~~~~~~ ^
src/greenlet/greenlet_greenlet.hpp:834:37: error: no member named 'recursion_limit' in '_ts'; did you mean 'py_recursion_limit'?
this->recursion_depth = tstate->recursion_limit - tstate->recursion_remaining;
^~~~~~~~~~~~~~~
py_recursion_limit
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/pystate.h:148:9: note: 'py_recursion_limit' declared here
int py_recursion_limit;
^
In file included from src/greenlet/greenlet.cpp:19:
In file included from src/greenlet/greenlet_internal.hpp:20:
src/greenlet/greenlet_greenlet.hpp:834:63: error: no member named 'recursion_remaining' in '_ts'; did you mean 'c_recursion_remaining'?
this->recursion_depth = tstate->recursion_limit - tstate->recursion_remaining;
^~~~~~~~~~~~~~~~~~~
c_recursion_remaining
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/pystate.h:150:9: note: 'c_recursion_remaining' declared here
int c_recursion_remaining;
^
In file included from src/greenlet/greenlet.cpp:19:
In file included from src/greenlet/greenlet_internal.hpp:20:
src/greenlet/greenlet_greenlet.hpp:848:42: error: no member named 'trash_delete_nesting' in '_ts'
this->trash_delete_nesting = tstate->trash_delete_nesting;
~~~~~~ ^
src/greenlet/greenlet_greenlet.hpp:867:21: error: no member named 'use_tracing' in '_PyCFrame'
tstate->cframe->use_tracing = this->use_tracing;
~~~~~~~~~~~~~~ ^
src/greenlet/greenlet_greenlet.hpp:870:13: error: no member named 'recursion_remaining' in '_ts'; did you mean 'c_recursion_remaining'?
tstate->recursion_remaining = tstate->recursion_limit - this->recursion_depth;
^~~~~~~~~~~~~~~~~~~
c_recursion_remaining
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/pystate.h:150:9: note: 'c_recursion_remaining' declared here
int c_recursion_remaining;
^
In file included from src/greenlet/greenlet.cpp:19:
In file included from src/greenlet/greenlet_internal.hpp:20:
src/greenlet/greenlet_greenlet.hpp:870:43: error: no member named 'recursion_limit' in '_ts'; did you mean 'py_recursion_limit'?
tstate->recursion_remaining = tstate->recursion_limit - this->recursion_depth;
^~~~~~~~~~~~~~~
py_recursion_limit
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/pystate.h:148:9: note: 'py_recursion_limit' declared here
int py_recursion_limit;
^
In file included from src/greenlet/greenlet.cpp:19:
In file included from src/greenlet/greenlet_internal.hpp:20:
src/greenlet/greenlet_greenlet.hpp:881:13: error: no member named 'trash_delete_nesting' in '_ts'
tstate->trash_delete_nesting = this->trash_delete_nesting;
~~~~~~ ^
src/greenlet/greenlet_greenlet.hpp:891:48: error: no member named 'use_tracing' in '_PyCFrame'
this->use_tracing = origin_tstate->cframe->use_tracing;
~~~~~~~~~~~~~~~~~~~~~ ^
src/greenlet/greenlet_greenlet.hpp:899:37: error: no member named 'recursion_limit' in '_ts'; did you mean 'py_recursion_limit'?
this->recursion_depth = tstate->recursion_limit - tstate->recursion_remaining;
^~~~~~~~~~~~~~~
py_recursion_limit
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/pystate.h:148:9: note: 'py_recursion_limit' declared here
int py_recursion_limit;
^
In file included from src/greenlet/greenlet.cpp:19:
In file included from src/greenlet/greenlet_internal.hpp:20:
src/greenlet/greenlet_greenlet.hpp:899:63: error: no member named 'recursion_remaining' in '_ts'; did you mean 'c_recursion_remaining'?
this->recursion_depth = tstate->recursion_limit - tstate->recursion_remaining;
^~~~~~~~~~~~~~~~~~~
c_recursion_remaining
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/pystate.h:150:9: note: 'c_recursion_remaining' declared here
int c_recursion_remaining;
^
In file included from src/greenlet/greenlet.cpp:21:
In file included from src/greenlet/greenlet_slp_switch.hpp:82:
In file included from src/greenlet/slp_platformselect.h:53:
src/greenlet/platform/switch_aarch64_gcc.h:71:51: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths]
__asm__ volatile ("mov %0, #0" : "=r" (err));
^
src/greenlet/platform/switch_aarch64_gcc.h:71:35: note: use constraint modifier "w"
__asm__ volatile ("mov %0, #0" : "=r" (err));
^~
%w0
src/greenlet/greenlet.cpp:3095:36: error: no member named 'trash_delete_nesting' in '_ts'
return PyLong_FromLong(tstate->trash_delete_nesting);
~~~~~~ ^
1 warning and 12 errors generated.
error: command '/usr/bin/clang' failed with exit code 1
at .venv/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
160│
161│ error = ChefBuildError("\n\n".join(message_parts))
162│
163│ if error is not None:
→ 164│ raise error from None
165│
166│ return path
167│
168│ 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 greenlet (2.0.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "greenlet (==2.0.2)"'.
- Installing httpcore (0.16.3)
- Installing mako (1.2.4)
- Installing mirakuru (2.5.1)
- Installing mypy-extensions (1.0.0)
- Installing port-for (0.6.3)
- Installing pydantic (1.10.6)
- Installing pytest (7.2.2)
- Installing rfc3986 (1.5.0)
- Installing setuptools (67.6.0)
- Installing sqlalchemy (2.0.7)
- Installing starlette (0.26.1)
Hi, so it's been quite a long time since I wrote this. Also you are using macos and I wrote it using Linux. So those things might contribute for dependencies to break. I don't think there should be a lot of differences by updating most packages, so I suggest you try to update them. You can check in the poetry.lock file which dependencies are requiring greenlet and then update them in pyproject.toml
I just revisited this, and it seems to happen if you are using a poetry that wasn't installed with the right python. For example if you installed poetry with homebrew. See e.g. https://github.com/python-poetry/poetry/issues/7583#issuecomment-1875363270
To fix it, try something like the comment:
install the python you want with homebrew.
brew install [email protected]
use pip that came with that python to install pipx.
pip3.11 install pipx
use pipx to install poetry
pipx install poetry