Python Playwright 打包报错 Please run the following command to download new browsers

简介: Python Playwright 打包报错 Please run the following command to download new browsers
  • 想做一个浏览器自动化的小插件,本地安装了 Playwright,测试可以正常打开浏览器自动化。
  • 但是在使用 PyInstallerPython 代码打包成 app/exe 后,打开应用程序报错:
playwright._impl._api_types.Error: Executable doesn't exist at /Users/dengzemiao/Desktop/Project/python/dist/main/playwright/driver/package/.local-browsers/chromium-1033/chrome-mac/Chromium.app/Contents/MacOS/Chromium
╔════════════════════════════════════════════════════════════╗
║ Looks like Playwright was just installed or updated.       ║
║ Please run the following command to download new browsers: ║
║                                                            ║
║     playwright install                                     ║
║                                                            ║
║ <3 Playwright Team                                         ║
╚════════════════════════════════════════════════════════════╝
  • 原因是:Playwright 没有被打到包内,解决方案
# 重新安装一下(chromium 是其中一个浏览器插件,看自己用什么就装什么)
#  Expecting one of: chromium, chrome, chrome-beta, msedge, msedge-beta, msedge-dev, firefox, webkit
$ PLAYWRIGHT_BROWSERS_PATH=0 playwright install chromium
# 然后再次打包
pyinstaller -F main.py
相关文章
|
1月前
|
JavaScript 前端开发 Python
【python自动化】Playwright基础教程(三)定位操作
【python自动化】Playwright基础教程(三)定位操作
54 0
|
2月前
|
缓存 前端开发 测试技术
(译)Python 官方团队在打包项目中踩过的坑
(译)Python 官方团队在打包项目中踩过的坑
32 2
|
1月前
|
Python
【python自动化】Playwright基础教程(五)事件操作②悬停&输入&清除精讲
【python自动化】Playwright基础教程(五)事件操作②悬停&输入&清除精讲
53 0
|
2月前
|
安全 网络安全 API
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
74 1
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
|
12天前
|
Python
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
|
1月前
|
存储 UED 开发者
Python语言的软件打包及发布
Python语言的软件打包及发布
|
1月前
|
Linux 数据库连接 数据库
Python如何将项目直接打包为一键整合包
Python如何将项目直接打包为一键整合包
42 0
|
1月前
|
API Python
【python自动化】Playwright基础教程(四)事件操作①高亮&元素匹配器&鼠标悬停
【python自动化】Playwright基础教程(四)事件操作①高亮&元素匹配器&鼠标悬停
23 0
|
1月前
|
Web App开发 Python
【python自动化】Playwright基础教程(二)
【python自动化】Playwright基础教程(二)
36 0
|
1月前
|
索引 Python
Python程序报错合集
Python程序报错合集
14 0