daijro / hrequests

🚀 Web scraping for humans
https://daijro.gitbook.io/hrequests/
MIT License
654 stars 39 forks source link

hrequests[all] doesn't support Python 3.12 #39

Closed HOSEENJ closed 6 months ago

HOSEENJ commented 6 months ago

i tried to install with pip install -U hrequests[all] but got this problem: i have installed these Individual components by visual studio installer: C++ Cmake tools for Windows Testing tools core features C++ Address Sanitizer command: pip install -U hrequests[all] Error: Using cached playwright_stealth-1.0.6-py3-none-any.whl (28 kB) Building wheels for collected packages: greenlet Building wheel for greenlet (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [120 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-312 creating build\lib.win-amd64-cpython-312\greenlet copying src\greenlet__init.py -> build\lib.win-amd64-cpython-312\greenlet creating build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\init.py -> build\lib.win-amd64-cpython-312\greenlet\platform creating build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\leakcheck.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_contextvars.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_cpp.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_extension_interface.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_gc.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_generator.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_generator_nested.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_greenlet.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_greenlet_trash.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_leaks.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_stack_saved.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_throw.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_tracing.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_version.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\test_weakref.py -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests\init__.py -> build\lib.win-amd64-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.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet.h -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_allocator.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_compiler_compat.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_cpython_compat.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_exceptions.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_greenlet.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_internal.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_refs.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_slp_switch.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_thread_state.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_thread_state_dict_cleanup.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\greenlet_thread_support.hpp -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\slp_platformselect.h -> build\lib.win-amd64-cpython-312\greenlet copying src\greenlet\platform\setup_switch_x64_masm.cmd -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_aarch64_gcc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_alpha_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_amd64_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_arm32_gcc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_arm32_ios.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_arm64_masm.asm -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_arm64_masm.obj -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_arm64_msvc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_csky_gcc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_m68k_gcc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_mips_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_ppc64_aix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_ppc64_linux.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_ppc_aix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_ppc_linux.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_ppc_macosx.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_ppc_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_riscv_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_s390_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_sparc_sun_gcc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_x32_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_x64_masm.asm -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_x64_masm.obj -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_x64_msvc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_x86_msvc.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\platform\switch_x86_unix.h -> build\lib.win-amd64-cpython-312\greenlet\platform copying src\greenlet\tests_test_extension.c -> build\lib.win-amd64-cpython-312\greenlet\tests copying src\greenlet\tests_test_extension_cpp.cpp -> build\lib.win-amd64-cpython-312\greenlet\tests running build_ext building 'greenlet._greenlet' extension creating build\temp.win-amd64-cpython-312 creating build\temp.win-amd64-cpython-312\Release creating build\temp.win-amd64-cpython-312\Release\src creating build\temp.win-amd64-cpython-312\Release\src\greenlet "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWIN32=1 -IC:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include -IC:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" /EHsc /Tpsrc/greenlet/greenlet.cpp /Fobuild\temp.win-amd64-cpython-312\Release\src/greenlet/greenlet.obj /EHsr /GT greenlet.cpp C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(831): error C2039: 'use_tracing': is not a member of '_PyCFrame' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(67): note: see declaration of '_PyCFrame' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(834): error C2039: 'recursion_limit': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(834): error C2039: 'recursion_remaining': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(848): error C2039: 'trash_delete_nesting': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(867): error C2039: 'use_tracing': is not a member of '_PyCFrame' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(67): note: see declaration of '_PyCFrame' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(870): error C2039: 'recursion_remaining': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(870): error C2039: 'recursion_limit': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(881): error C2039: 'trash_delete_nesting': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(891): error C2039: 'use_tracing': is not a member of '_PyCFrame' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(67): note: see declaration of '_PyCFrame' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(899): error C2039: 'recursion_limit': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' C:\Users\HOSEEN\AppData\Local\Temp\pip-install-xc72bsav\greenlet_678fbe0f7a954225994ef76c8021962b\src\greenlet\greenlet_greenlet.hpp(899): error C2039: 'recursion_remaining': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' src/greenlet/greenlet.cpp(3095): error C2039: 'trash_delete_nesting': is not a member of '_ts' C:\Users\HOSEEN\AppData\Local\Programs\Python\Python312\include\cpython/pystate.h(115): note: see declaration of '_ts' error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for greenlet Running setup.py clean for greenlet Failed to build greenlet ERROR: Could not build wheels for greenlet, which is required to install pyproject.toml-based projects

python version: 3.12.2 OS: Windows How can i fix this error?

daijro commented 6 months ago

Seems to be an issue with the version of Playwright hrequests uses. Unfortunately, Playwright cannot be updated due to the differences in how Errors are imported/handled, and how extensions are added to Chromium browsers.

In v0.9.0, hrequests will reimplement these features to allow newer versions of Playwright to be fully supported. However, for now, hrequests[all] won't be able to install on Windows on v0.8.x until a working solution for installing Playwright 1.34.0 is found.

Thanks! 👍