gpt4 book ai didi

pipenv - 执行 pipfile 脚本

转载 作者:行者123 更新时间:2023-12-03 21:24:16 26 4
gpt4 key购买 nike

如何执行 Pipfile 中定义的脚本?

遵循找到的语法 here ,我在我的 pipfile 中定义了 scripts 部分,如下所示:

[scripts]
tests = "bash ./run-tests.sh"

运行后 $ pipenv install ,如何调用 tests脚本?

我尝试了以下但没有成功:
$ tests $ pipenv tests $ pipenv run tests $ pipenv shell
(virtual env) $ tests

最佳答案

我遇到了同样的问题,由于 this issue 中的讨论,我碰巧解决了它.

长话短说,在开始我的项目之前,我只在全局范围内更新了 pipenv,而不是在本地更新。所以我仍然使用旧版本。

正确更新 pipenv 的版本您正在使用,您必须升级 pipenv也适用于您用于项目的用户。
因此 :

$ sudo pip install pipenv --upgrade --user

解决了我的问题。

愿这个愚蠢的错误成为我的第一个 SO 贡献,以及我永远的耻辱。

编辑 :

Coleman Stoltze 所述,调用脚本的正确方法是:

$ pipenv run tests

关于pipenv - 执行 pipfile 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49519208/

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