gpt4 book ai didi

python - pipenv 安装后操作

转载 作者:行者123 更新时间:2023-12-05 05:46:22 26 4
gpt4 key购买 nike

我通过 Pharo/GToolkit 的 PythonBridge 使用 Python ,它在底层使用了 pipenv。

事情是通过这个内置的 PythonBridge 脚本 (install_env.sh) 启动的:

#!/bin/bash
cd "$(dirname "$0")"
export PIPENV_VENV_IN_PROJECT=1
pipenv install
pipenv run pip install debugpy

我的 Pipfile 中的一个依赖项是 Playwright . Its docs list two main steps to installation :

pip install playwright
playwright install

我的问题是:我应该把第二个 playwright install 命令“放”在哪里?

更改 install_env.sh 似乎不切实际,它在某个时候由 PythonBridge 生成。我希望 pipenv 可能有一个“安装后脚本 Hook ”的概念,但 DuckDuckGo 会使用这些词的各种组合,以及阅读 the pipenv docs没有透露任何看似有用的信息。

最佳答案

Until it's actually supported ,解决方法是在您的 Pipfile 中使用脚本:

[scripts]
hooks = "playwright install"

然后运行 ​​pipenv install && pipenv run hooks

具有多个钩子(Hook)的示例:

[scripts]
hooks = "bash -c 'pipenv run hook_1 && pipenv run hook_2'"
hook_1 = "some_command"
hook_2 = "another_command"

关于python - pipenv 安装后操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71198370/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com