microsoft / playwright-python

Python version of the Playwright testing and automation library.
https://playwright.dev/python/
Apache License 2.0
11.54k stars 881 forks source link

[Bug]: Won't install in Windows in Python 3.13 due to pinning to an obsolete version of greenlet #2564

Open mborsetti opened 3 hours ago

mborsetti commented 3 hours ago

Version

1.47.0 (latest)

Steps to reproduce

  1. Execute pip install playwright
  2. You should see the below error
C:\Windows\System32>python313 -m pip install playwright
Collecting playwright
  Downloading playwright-1.47.0-py3-none-win_amd64.whl.metadata (3.5 kB)
Collecting greenlet==3.0.3 (from playwright)
  Downloading greenlet-3.0.3.tar.gz (182 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pyee==12.0.0 (from playwright)
  Downloading pyee-12.0.0-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: typing-extensions in c:\program files\python\python313\lib\site-packages (from pyee==12.0.0->playwright) (4.12.2)
Downloading psutil-6.0.0-cp37-abi3-win_amd64.whl (257 kB)
Downloading playwright-1.47.0-py3-none-win_amd64.whl (29.9 MB)
   ---------------------------------------- 29.9/29.9 MB 11.4 MB/s eta 0:00:00
Downloading pyee-12.0.0-py3-none-any.whl (14 kB)
Building wheels for collected packages: greenlet
  Building wheel for greenlet (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for greenlet (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [106 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\__init__.py -> build\lib.win-amd64-cpython-313\greenlet
      creating build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\__init__.py -> build\lib.win-amd64-cpython-313\greenlet\platform
      creating build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\fail_clearing_run_switches.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\fail_cpp_exception.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\fail_initialstub_already_started.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\fail_slp_switch.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\fail_switch_three_greenlets.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\fail_switch_three_greenlets2.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\fail_switch_two_greenlets.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\leakcheck.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_contextvars.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_cpp.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_extension_interface.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_gc.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_generator.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_generator_nested.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_greenlet.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_greenlet_trash.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_leaks.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_stack_saved.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_throw.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_tracing.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_version.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\test_weakref.py -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\__init__.py -> build\lib.win-amd64-cpython-313\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\TBrokenGreenlet.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TExceptionState.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TGreenlet.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TGreenletGlobals.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TMainGreenlet.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TPythonState.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TStackState.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TThreadStateDestroy.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\TUserGreenlet.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet.cpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet.h -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_allocator.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_compiler_compat.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_cpython_add_pending.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_cpython_compat.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_exceptions.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_greenlet.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_internal.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_refs.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_slp_switch.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_thread_state.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_thread_state_dict_cleanup.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\greenlet_thread_support.hpp -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\slp_platformselect.h -> build\lib.win-amd64-cpython-313\greenlet
      copying src\greenlet\platform\setup_switch_x64_masm.cmd -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_aarch64_gcc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_alpha_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_amd64_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_arm32_gcc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_arm32_ios.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_arm64_masm.asm -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_arm64_masm.obj -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_arm64_msvc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_csky_gcc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_loongarch64_linux.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_m68k_gcc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_mips_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_ppc64_aix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_ppc64_linux.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_ppc_aix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_ppc_linux.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_ppc_macosx.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_ppc_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_riscv_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_s390_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_sparc_sun_gcc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_x32_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_x64_masm.asm -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_x64_masm.obj -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_x64_msvc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_x86_msvc.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\platform\switch_x86_unix.h -> build\lib.win-amd64-cpython-313\greenlet\platform
      copying src\greenlet\tests\_test_extension.c -> build\lib.win-amd64-cpython-313\greenlet\tests
      copying src\greenlet\tests\_test_extension_cpp.cpp -> build\lib.win-amd64-cpython-313\greenlet\tests
      running build_ext
      building 'greenlet._greenlet' extension
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for greenlet
Failed to build greenlet
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (greenlet)

Note that the actual release of greenlet installs just fine:

C:\Windows\System32>python313 -m pip install greenlet
Collecting greenlet
  Downloading greenlet-3.1.0-cp313-cp313-win_amd64.whl.metadata (3.9 kB)
Downloading greenlet-3.1.0-cp313-cp313-win_amd64.whl (294 kB)
Installing collected packages: greenlet
Successfully installed greenlet-3.1.0

Any chance you can stop pinning so we don't have to live in dependency (and installation) hell?

Expected behavior

Would install and work

Actual behavior

Would not install

Additional context

No response

Environment

- Operating System: [Windows 11]
- CPU: [arm64]
- Browser: [All, Chromium, Firefox, WebKit]
- Python Version: [3.13]
- Other info:
mborsetti commented 3 hours ago

Tip to others who are running into this issue: https://stackoverflow.com/questions/70449073/pip-how-to-override-version-of-sub-dependency-in-requirements-txt

pip install --no-deps playwright greenlet pyee