我创建了一个脚本并使用pyinstaller将它转换为一个.exe文件,但是在没有遇到以下错误的情况下无法运行.exe:
*Traceback (most recent call last):
File "main.py", line 31, in <module>
File "playwright\sync_api\_generated.py", line 11436, in launch
File "playwright\_impl\_sync_base.py", line 111, in _sync
File "playwright\_impl\_browser_type.py", line 90, in launch
File "playwright\_impl\_connection.py", line 39, in send
File "playwright\_impl\_connection.py", line 63, in inner_send
playwright._impl._api_types.Error: Executable doesn't exist at C:\(...)\chrome.exe*
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers: ║
║ ║
║ playwright install ║
║ ║
║ <3 Playwright Team ║
╚═════════════════════════════════════════════════════════════════════════╝
[9084] Failed to execute script 'main' due to unhandled exception!我已经在电脑上安装了剧作家。

我该怎么解决这个问题?
发布于 2022-03-19 11:02:54
您需要通过执行playwright install或python -m playwright install来安装浏览器--参见:https://playwright.dev/python/docs/intro#installation
发布于 2022-07-12 03:37:26
必须首先安装剧作家将使用的浏览器。为此,输入bash:
PLAYWRIGHT_BROWSERS_PATH=0 playwright install chromium
pyinstaller -F main.pyhttps://stackoverflow.com/questions/71507913
复制相似问题