Reputation: 3923
I want that pip
always installs into $HOME
just as if I type
pip install --user ...
But I don't want to type --user
all the time. I think setting an environment variable would be a good solution but I'm not sure and I didn't find anything.
Upvotes: 1
Views: 296
Reputation: 26903
Based on other answers, here's a bash function to add to you .bash_profile
:
function pip {
if [ "$1" == "install" ] || [ "$1" == "bundle" ]; then
/usr/local/bin/pip $1 --user ${@:2}
else
/usr/local/bin/pip $@
fi
}
Upvotes: 0
Reputation: 3923
Here is my solution based on the idea of unutbu:
~/bin/ppip
(p ersonal pip):
#!/bin/sh
if [ "$1" == "install" ] || [ "$1" == "bundle" ]
then
pip $1 --user ${@:2}
else
pip $@
fi
Improvements are welcome.
Upvotes: 2