Skip to content

[Bug]: Building wheel fails on Windows #2827

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

Closed
neoncube2 opened this issue Apr 28, 2025 · 6 comments · Fixed by #2838
Closed

[Bug]: Building wheel fails on Windows #2827

neoncube2 opened this issue Apr 28, 2025 · 6 comments · Fixed by #2838

Comments

@neoncube2
Copy link
Contributor

Version

main branch of playwright-python

Steps to reproduce

Example steps (replace with your own):

  1. Clone the playwright-python repo
  2. Run these commands:
python -m venv env
env\Scripts\activate
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
python -m build --wheel

python -m build --wheel fails with this error:

removing build\bdist.win-amd64\wheel
Traceback (most recent call last):
  File "C:\Users\elibl\Desktop\Skorm\playwright-python\env\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
    main()
    ~~~~^^
  File "C:\Users\elibl\Desktop\Skorm\playwright-python\env\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\elibl\Desktop\Skorm\playwright-python\env\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 280, in build_wheel
    return _build_backend().build_wheel(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        wheel_directory, config_settings, metadata_directory
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 435, in build_wheel
    return _build(['bdist_wheel'])
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 426, in _build
    return self._build_with_temp_dir(
           ~~~~~~~~~~~~~~~~~~~~~~~~~^
        cmd,
        ^^^^
    ...<3 lines>...
        self._arbitrary_args(config_settings),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 407, in _build_with_temp_dir
    self.run_setup()
    ~~~~~~~~~~~~~~^^
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
    exec(code, locals())
    ~~~~^^^^^^^^^^^^^^^^
  File "<string>", line 196, in <module>
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\__init__.py", line 117, in setup
    return distutils.core.setup(**attrs)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\_distutils\core.py", line 186, in setup
    return run_commands(dist)
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\_distutils\core.py", line 202, in run_commands
    dist.run_commands()
    ~~~~~~~~~~~~~~~~~^^
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\_distutils\dist.py", line 1002, in run_commands
    self.run_command(cmd)
    ~~~~~~~~~~~~~~~~^^^^^
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\dist.py", line 1104, in run_command
    super().run_command(command)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\_distutils\dist.py", line 1021, in run_command
    cmd_obj.run()
    ~~~~~~~~~~~^^
  File "<string>", line 116, in run
  File "<string>", line 192, in _download_and_extract_local_driver
  File "C:\Program Files\Python313\Lib\zipfile\__init__.py", line 1385, in __init__
    self._RealGetContents()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Program Files\Python313\Lib\zipfile\__init__.py", line 1452, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

ERROR Backend subprocess exited when trying to invoke build_wheel
``

Full output:
  • Creating isolated environment: venv+pip...

  • Installing packages in isolated environment:

    • auditwheel==6.2.0
    • setuptools-scm==8.2.0
    • setuptools==78.1.0
    • wheel==0.45.1
  • Getting build dependencies for wheel...
    C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\config_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: project.license as a TOML table is deprecated
    !!

      ********************************************************************************
      Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).
    
      By 2026-Feb-18, you need to update your project and remove deprecated calls
      or your builds will no longer be supported.
    
      See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
      ********************************************************************************
    

!!
corresp(dist, value, root_dir)
C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\config_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

    ********************************************************************************
    Please consider removing the following classifiers in favor of a SPDX license expression:

    License :: OSI Approved :: Apache Software License

    See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
    ********************************************************************************

!!
dist._finalize_license_expression()
C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

    ********************************************************************************
    Please consider removing the following classifiers in favor of a SPDX license expression:

    License :: OSI Approved :: Apache Software License

    See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
    ********************************************************************************

!!
self._finalize_license_expression()
running egg_info
writing playwright.egg-info\PKG-INFO
writing dependency_links to playwright.egg-info\dependency_links.txt
writing entry points to playwright.egg-info\entry_points.txt
writing requirements to playwright.egg-info\requires.txt
writing top-level names to playwright.egg-info\top_level.txt
adding license file 'LICENSE'
writing manifest file 'playwright.egg-info\SOURCES.txt'

  • Building wheel...
    C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\config_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: project.license as a TOML table is deprecated
    !!

      ********************************************************************************
      Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).
    
      By 2026-Feb-18, you need to update your project and remove deprecated calls
      or your builds will no longer be supported.
    
      See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
      ********************************************************************************
    

!!
corresp(dist, value, root_dir)
C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\config_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

    ********************************************************************************
    Please consider removing the following classifiers in favor of a SPDX license expression:

    License :: OSI Approved :: Apache Software License

    See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
    ********************************************************************************

!!
dist._finalize_license_expression()
C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

    ********************************************************************************
    Please consider removing the following classifiers in favor of a SPDX license expression:

    License :: OSI Approved :: Apache Software License

    See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
    ********************************************************************************

!!
self.finalize_license_expression()
running bdist_wheel
running build
running build_py
copying playwright_repo_version.py -> build\lib\playwright
copying playwright_init
.py -> build\lib\playwright
copying playwright_main_.py -> build\lib\playwright
copying playwright\async_api_context_manager.py -> build\lib\playwright\async_api
copying playwright\async_api_generated.py -> build\lib\playwright\async_api
copying playwright\async_api_init_.py -> build\lib\playwright\async_api
copying playwright\sync_api_context_manager.py -> build\lib\playwright\sync_api
copying playwright\sync_api_generated.py -> build\lib\playwright\sync_api
copying playwright\sync_api_init_.py -> build\lib\playwright\sync_api
copying playwright_impl_accessibility.py -> build\lib\playwright_impl
copying playwright_impl_api_structures.py -> build\lib\playwright_impl
copying playwright_impl_artifact.py -> build\lib\playwright_impl
copying playwright_impl_assertions.py -> build\lib\playwright_impl
copying playwright_impl_async_base.py -> build\lib\playwright_impl
copying playwright_impl_browser.py -> build\lib\playwright_impl
copying playwright_impl_browser_context.py -> build\lib\playwright_impl
copying playwright_impl_browser_type.py -> build\lib\playwright_impl
copying playwright_impl_cdp_session.py -> build\lib\playwright_impl
copying playwright_impl_clock.py -> build\lib\playwright_impl
copying playwright_impl_connection.py -> build\lib\playwright_impl
copying playwright_impl_console_message.py -> build\lib\playwright_impl
copying playwright_impl_dialog.py -> build\lib\playwright_impl
copying playwright_impl_download.py -> build\lib\playwright_impl
copying playwright_impl_driver.py -> build\lib\playwright_impl
copying playwright_impl_element_handle.py -> build\lib\playwright_impl
copying playwright_impl_errors.py -> build\lib\playwright_impl
copying playwright_impl_event_context_manager.py -> build\lib\playwright_impl
copying playwright_impl_fetch.py -> build\lib\playwright_impl
copying playwright_impl_file_chooser.py -> build\lib\playwright_impl
copying playwright_impl_frame.py -> build\lib\playwright_impl
copying playwright_impl_glob.py -> build\lib\playwright_impl
copying playwright_impl_greenlets.py -> build\lib\playwright_impl
copying playwright_impl_har_router.py -> build\lib\playwright_impl
copying playwright_impl_helper.py -> build\lib\playwright_impl
copying playwright_impl_impl_to_api_mapping.py -> build\lib\playwright_impl
copying playwright_impl_input.py -> build\lib\playwright_impl
copying playwright_impl_json_pipe.py -> build\lib\playwright_impl
copying playwright_impl_js_handle.py -> build\lib\playwright_impl
copying playwright_impl_local_utils.py -> build\lib\playwright_impl
copying playwright_impl_locator.py -> build\lib\playwright_impl
copying playwright_impl_map.py -> build\lib\playwright_impl
copying playwright_impl_network.py -> build\lib\playwright_impl
copying playwright_impl_object_factory.py -> build\lib\playwright_impl
copying playwright_impl_page.py -> build\lib\playwright_impl
copying playwright_impl_path_utils.py -> build\lib\playwright_impl
copying playwright_impl_playwright.py -> build\lib\playwright_impl
copying playwright_impl_selectors.py -> build\lib\playwright_impl
copying playwright_impl_set_input_files_helpers.py -> build\lib\playwright_impl
copying playwright_impl_stream.py -> build\lib\playwright_impl
copying playwright_impl_str_utils.py -> build\lib\playwright_impl
copying playwright_impl_sync_base.py -> build\lib\playwright_impl
copying playwright_impl_tracing.py -> build\lib\playwright_impl
copying playwright_impl_transport.py -> build\lib\playwright_impl
copying playwright_impl_video.py -> build\lib\playwright_impl
copying playwright_impl_waiter.py -> build\lib\playwright_impl
copying playwright_impl_web_error.py -> build\lib\playwright_impl
copying playwright_impl_writable_stream.py -> build\lib\playwright_impl
copying playwright_impl_init_.py -> build\lib\playwright_impl
copying playwright_impl__pyinstaller\hook-playwright.async_api.py -> build\lib\playwright_impl__pyinstaller
copying playwright_impl__pyinstaller\hook-playwright.sync_api.py -> build\lib\playwright_impl__pyinstaller
copying playwright_impl_pyinstaller_init.py -> build\lib\playwright_impl__pyinstaller
running egg_info
writing playwright.egg-info\PKG-INFO
writing dependency_links to playwright.egg-info\dependency_links.txt
writing entry points to playwright.egg-info\entry_points.txt
writing requirements to playwright.egg-info\requires.txt
writing top-level names to playwright.egg-info\top_level.txt
adding license file 'LICENSE'
writing manifest file 'playwright.egg-info\SOURCES.txt'
copying playwright\py.typed -> build\lib\playwright
copying playwright_impl__pyinstaller\hook-playwright.async_api.py -> build\lib\playwright_impl_pyinstaller
copying playwright_impl_pyinstaller\hook-playwright.sync_api.py -> build\lib\playwright_impl_pyinstaller
installing to build\bdist.win-amd64\wheel
running install
running install_lib
creating build\bdist.win-amd64\wheel
creating build\bdist.win-amd64\wheel\playwright
creating build\bdist.win-amd64\wheel\playwright\async_api
copying build\lib\playwright\async_api_context_manager.py -> build\bdist.win-amd64\wheel.\playwright\async_api
copying build\lib\playwright\async_api_generated.py -> build\bdist.win-amd64\wheel.\playwright\async_api
copying build\lib\playwright\async_api_init
.py -> build\bdist.win-amd64\wheel.\playwright\async_api
copying build\lib\playwright\py.typed -> build\bdist.win-amd64\wheel.\playwright
creating build\bdist.win-amd64\wheel\playwright\sync_api
copying build\lib\playwright\sync_api_context_manager.py -> build\bdist.win-amd64\wheel.\playwright\sync_api
copying build\lib\playwright\sync_api_generated.py -> build\bdist.win-amd64\wheel.\playwright\sync_api
copying build\lib\playwright\sync_api_init
.py -> build\bdist.win-amd64\wheel.\playwright\sync_api
creating build\bdist.win-amd64\wheel\playwright_impl
copying build\lib\playwright_impl_accessibility.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_api_structures.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_artifact.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_assertions.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_async_base.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_browser.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_browser_context.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_browser_type.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_cdp_session.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_clock.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_connection.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_console_message.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_dialog.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_download.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_driver.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_element_handle.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_errors.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_event_context_manager.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_fetch.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_file_chooser.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_frame.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_glob.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_greenlets.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_har_router.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_helper.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_impl_to_api_mapping.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_input.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_json_pipe.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_js_handle.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_local_utils.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_locator.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_map.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_network.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_object_factory.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_page.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_path_utils.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_playwright.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_selectors.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_set_input_files_helpers.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_stream.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_str_utils.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_sync_base.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_tracing.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_transport.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_video.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_waiter.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_web_error.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_writable_stream.py -> build\bdist.win-amd64\wheel.\playwright_impl
copying build\lib\playwright_impl_init
.py -> build\bdist.win-amd64\wheel.\playwright_impl
creating build\bdist.win-amd64\wheel\playwright_impl__pyinstaller
copying build\lib\playwright_impl__pyinstaller\hook-playwright.async_api.py -> build\bdist.win-amd64\wheel.\playwright_impl__pyinstaller
copying build\lib\playwright_impl__pyinstaller\hook-playwright.sync_api.py -> build\bdist.win-amd64\wheel.\playwright_impl_pyinstaller
copying build\lib\playwright_impl_pyinstaller_init.py -> build\bdist.win-amd64\wheel.\playwright_impl_pyinstaller
copying build\lib\playwright_repo_version.py -> build\bdist.win-amd64\wheel.\playwright
copying build\lib\playwright_init
.py -> build\bdist.win-amd64\wheel.\playwright
copying build\lib\playwright_main
.py -> build\bdist.win-amd64\wheel.\playwright
running install_egg_info
Copying playwright.egg-info to build\bdist.win-amd64\wheel.\playwright-0.1.dev923+g68d96cb-py3.13.egg-info
running install_scripts
creating build\bdist.win-amd64\wheel\playwright-0.1.dev923+g68d96cb.dist-info\WHEEL
creating 'C:\Users\elibl\Desktop\Skorm\playwright-python\dist.tmp-m775ph6n\playwright-0.1.dev923+g68d96cb-py3-none-any.whl' and adding 'build\bdist.win-amd64\wheel' to it
adding 'playwright/init.py'
adding 'playwright/main.py'
adding 'playwright/_repo_version.py'
adding 'playwright/py.typed'
adding 'playwright/_impl/init.py'
adding 'playwright/_impl/_accessibility.py'
adding 'playwright/_impl/_api_structures.py'
adding 'playwright/_impl/_artifact.py'
adding 'playwright/_impl/_assertions.py'
adding 'playwright/_impl/_async_base.py'
adding 'playwright/_impl/_browser.py'
adding 'playwright/_impl/_browser_context.py'
adding 'playwright/_impl/_browser_type.py'
adding 'playwright/_impl/_cdp_session.py'
adding 'playwright/_impl/_clock.py'
adding 'playwright/_impl/_connection.py'
adding 'playwright/_impl/_console_message.py'
adding 'playwright/_impl/_dialog.py'
adding 'playwright/_impl/_download.py'
adding 'playwright/_impl/_driver.py'
adding 'playwright/_impl/_element_handle.py'
adding 'playwright/_impl/_errors.py'
adding 'playwright/_impl/_event_context_manager.py'
adding 'playwright/_impl/_fetch.py'
adding 'playwright/_impl/_file_chooser.py'
adding 'playwright/_impl/_frame.py'
adding 'playwright/_impl/_glob.py'
adding 'playwright/_impl/_greenlets.py'
adding 'playwright/_impl/_har_router.py'
adding 'playwright/_impl/_helper.py'
adding 'playwright/_impl/_impl_to_api_mapping.py'
adding 'playwright/_impl/_input.py'
adding 'playwright/_impl/_js_handle.py'
adding 'playwright/_impl/_json_pipe.py'
adding 'playwright/_impl/_local_utils.py'
adding 'playwright/_impl/_locator.py'
adding 'playwright/_impl/_map.py'
adding 'playwright/_impl/_network.py'
adding 'playwright/_impl/_object_factory.py'
adding 'playwright/_impl/_page.py'
adding 'playwright/_impl/_path_utils.py'
adding 'playwright/_impl/_playwright.py'
adding 'playwright/_impl/_selectors.py'
adding 'playwright/_impl/_set_input_files_helpers.py'
adding 'playwright/_impl/_str_utils.py'
adding 'playwright/_impl/_stream.py'
adding 'playwright/_impl/_sync_base.py'
adding 'playwright/_impl/_tracing.py'
adding 'playwright/_impl/_transport.py'
adding 'playwright/_impl/_video.py'
adding 'playwright/_impl/_waiter.py'
adding 'playwright/_impl/_web_error.py'
adding 'playwright/_impl/_writable_stream.py'
adding 'playwright/_impl/__pyinstaller/init.py'
adding 'playwright/_impl/__pyinstaller/hook-playwright.async_api.py'
adding 'playwright/_impl/__pyinstaller/hook-playwright.sync_api.py'
adding 'playwright/async_api/init.py'
adding 'playwright/async_api/_context_manager.py'
adding 'playwright/async_api/_generated.py'
adding 'playwright/sync_api/init.py'
adding 'playwright/sync_api/_context_manager.py'
adding 'playwright/sync_api/_generated.py'
adding 'playwright-0.1.dev923+g68d96cb.dist-info/licenses/LICENSE'
adding 'playwright-0.1.dev923+g68d96cb.dist-info/METADATA'
adding 'playwright-0.1.dev923+g68d96cb.dist-info/WHEEL'
adding 'playwright-0.1.dev923+g68d96cb.dist-info/entry_points.txt'
adding 'playwright-0.1.dev923+g68d96cb.dist-info/top_level.txt'
adding 'playwright-0.1.dev923+g68d96cb.dist-info/RECORD'
removing build\bdist.win-amd64\wheel
Traceback (most recent call last):
File "C:\Users\elibl\Desktop\Skorm\playwright-python\env\Lib\site-packages\pyproject_hooks_in_process_in_process.py", line 389, in
main()
~~~~^^
File "C:\Users\elibl\Desktop\Skorm\playwright-python\env\Lib\site-packages\pyproject_hooks_in_process_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\elibl\Desktop\Skorm\playwright-python\env\Lib\site-packages\pyproject_hooks_in_process_in_process.py", line 280, in build_wheel
return _build_backend().build_wheel(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
wheel_directory, config_settings, metadata_directory
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 435, in build_wheel
return _build(['bdist_wheel'])
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 426, in _build
return self._build_with_temp_dir(
~~~~~~~~~~~~~~~~~~~~~~~~~^
cmd,
^^^^
...<3 lines>...
self._arbitrary_args(config_settings),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 407, in build_with_temp_dir
self.run_setup()
~~~~~~~~~~~~~~^^
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "", line 196, in
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools_init
.py", line 117, in setup
return distutils.core.setup(**attrs)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools_distutils\core.py", line 186, in setup
return run_commands(dist)
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools_distutils\core.py", line 202, in run_commands
dist.run_commands()
~~~~~~~~~~~~~~~~~^^
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools_distutils\dist.py", line 1002, in run_commands
self.run_command(cmd)
~~~~~~~~~~~~~~~~^^^^^
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools\dist.py", line 1104, in run_command
super().run_command(command)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\Users\elibl\AppData\Local\Temp\build-env-o8vzlatc\Lib\site-packages\setuptools_distutils\dist.py", line 1021, in run_command
cmd_obj.run()
~~~~~~~~~~~^^
File "", line 116, in run
File "", line 192, in download_and_extract_local_driver
File "C:\Program Files\Python313\Lib\zipfile_init
.py", line 1385, in init
self.RealGetContents()
~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Program Files\Python313\Lib\zipfile_init
.py", line 1452, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

ERROR Backend subprocess exited when trying to invoke build_wheel


### Expected behavior

Wheel should build successfully

### Actual behavior

See above

### Additional context

_No response_

### Environment

```Text
- Operating System: [Windows 11]
- CPU: [amd64]
- Browser: [N/A]
- Python Version: [3.13.2]
- Other info:
@neoncube2
Copy link
Contributor Author

The same commands works fine on Ubuntu 22:

removing build/bdist.linux-x86_64/wheel
Fetching https://playwright.azureedge.net/builds/driver/playwright-1.51.1-linux.zip

I guess the issue is that there's no https://playwright.azureedge.net/builds/driver/playwright-1.51.1-windows.zip ?

@mxschmitt
Copy link
Member

Do you know which URL it is downloading? There is https://playwright.azureedge.net/builds/driver/playwright-1.51.1-win32_x64.zip

@mxschmitt
Copy link
Member

@neoncube2
Copy link
Contributor Author

neoncube2 commented Apr 28, 2025

@mxschmitt Thanks! :)

It looks like the issue was that I killed the process (or my connection dropped) while playwright-1.51.1-win32_x64.zip was being downloaded, so I ended up with only a partial ZIP file.

setup.py contains these lines of code, so the ZIP file wasn't redownloaded when I ran python -m build --wheel the second time:

if os.path.exists("driver/" + zip_file):
  return

Deleting driver\playwright-1.51.1-win32_x64.zip and rerunning python -m build --wheel fixed the issue.

Would it make sense for setup.py to download the entire ZIP file before writing it to disk?

@mxschmitt
Copy link
Member

we could e.g. write into a .tmp file and then move the .tmp file to the actual location - that should probably fix that?

@neoncube2
Copy link
Contributor Author

@mxschmitt Sounds good to me! :)

I've opened a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants