← Back to Discord Forum

exe build

I wrote a code with the playwright library in python, but even if I translate it to exeye with pyinstaller and cx_Freeze, it gives playwright install error, how can I solve it?

File "C:\Program Files\Python311\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 124, in run
    module_init.run(name + "__main__")
  File "C:\Program Files\Python311\Lib\site-packages\cx_Freeze\initscripts\console.py", line 16, in run
    exec(code, module_main.__dict__)
  File "run.py", line 11, in <module>
    browser = playwright.firefox.launch_persistent_context(user_data_dir, headless=False)
  File "C:\Program Files\Python311\Lib\site-packages\playwright\sync_api\_generated.py", line 15031, in launch_persistent_context
  File "C:\Program Files\Python311\Lib\site-packages\playwright\_impl\_sync_base.py", line 109, in _sync
    return task.result()
  File "C:\Program Files\Python311\Lib\site-packages\playwright\_impl\_browser_type.py", line 158, in launch_persistent_context
    from_channel(await self._channel.send("launchPersistentContext", params)),
  File "C:\Program Files\Python311\Lib\site-packages\playwright\_impl\_connection.py", line 61, in send
    return await self._connection.wrap_api_call(
  File "C:\Program Files\Python311\Lib\site-packages\playwright\_impl\_connection.py", line 490, in wrap_api_call
    return await cb()
  File "C:\Program Files\Python311\Lib\site-packages\playwright\_impl\_connection.py", line 99, in inner_send
    result = next(iter(done)).result()
playwright._impl._api_types.Error: Executable doesn't exist at C:\Users\Administrator\Desktop\#\piton\stake\claim_bot\lib\playwright\driver\package\.local-browsers\firefox-1425\firefox\firefox.exe
║ Looks like Playwright was just installed or updated.       ║
║ Please run the following command to download new browsers: ║
║                                                            ║
║     playwright install                                     ║
║                                                            ║
║ <3 Playwright Team                                         ║

This thread is trying to answer question "How can I solve the playwright install error when I translate my code to exeye with pyinstaller and cx_Freeze?"

3 replies

What is your expectation with executable? Is it supposed to run tests?

Hm, well you will need to preinstall browsers before running exe then.

Related Discord Threads

AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.