[英]Unable to run python.exe containing playwright
I created a script and turn it into an .exe file using pyinstaller but was unable to run the .exe without encountering the following error:我创建了一个脚本并使用 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!
I have already installed playwright on my computer.我已经在我的电脑上安装了 playwright。
How do I fix this?我该如何解决?
您需要通过playwright install
或python -m playwright install
安装浏览器,请参见此处: https ://playwright.dev/python/docs/intro#installation
It is necessary to install the browser that will be used by playwright first.必须先安装剧作家使用的浏览器。 To do this, type in bash:为此,请输入 bash:
PLAYWRIGHT_BROWSERS_PATH=0 playwright install chromium
pyinstaller -F main.py
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.