使用pip安装时卡在软件许可协议上。

7 浏览
0 Comments

使用pip安装时卡在软件许可协议上。

我的公司要求在我们分发python包时,必须包括一个许可协议,安装程序在安装之前必须同意。有什么办法让pip互动吗?

例如:

pip install mypackage

没有任何欺骗,你同意这个条款吗?

pip 继续安装...

admin 更改状态以发布 2023年5月24日
0
0 Comments

你试过使用管道 yes 吗?

yes | pip install mypackage

EDIT:

我不认为 pip 能做到这一点,但你可以编写脚本来实现:

cat license.txt
read -p "Do you agree to the terms? " -n 1 -r
echo    # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
    pip install mypackage
fi

https://stackoverflow.com/a/1885534/1178781 拿来的狠狠的

0