当我通过普通的 Python 解释器运行 Playwright 时,它在我的机器上运行,但是当我尝试将它部署为 Azure 函数时,我得到了错误。
我正在尝试按照此处的说明进行操作,但我"webkit" browser was not found. Please complete Playwright installation via running "python -m playwright install"
认为这是一个错误,如果您使用的是 npm,则不会发生该错误。
我尝试创建一个包含以下步骤的 azure devops Pipeline:
- bash: |
python -m venv worker_venv
source worker_venv/bin/activate
pip install -r requirements.txt
python -m playwright install
workingDirectory: $(workingDirectory)
displayName: 'Install application dependencies'
我也试过从我的代码中做到这一点:
os.system('python -m playwright install')
我可以看到PLAYWRIGHT_BROWSERS_PATH
环境变量设置为0
.
如何让它在 Azure 函数上运行?