Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望它pip总是$HOME像我输入一样安装
pip
$HOME
pip install --user ...
但我不想一直打字--user。我认为设置环境变量是一个很好的解决方案,但我不确定,也没有找到任何东西。
--user
这是我基于unutbu想法的解决方案:
~/bin/ppip(个人点子):
~/bin/ppip
#!/bin/sh if [ "$1" == "install" ] || [ "$1" == "bundle" ] then pip $1 --user ${@:2} else pip $@ fi
欢迎改进。
你可以写一个小脚本:
我的点:
#!/bin/sh pip $@ --user
根据其他答案,这里有一个 bash 函数要添加给您.bash_profile:
.bash_profile
function pip { if [ "$1" == "install" ] || [ "$1" == "bundle" ]; then /usr/local/bin/pip $1 --user ${@:2} else /usr/local/bin/pip $@ fi }