Set PATH for Python PIP on fish shell

Β·

1 min read

If you want to install Python packages and run them as a command on Linux fish-shell, it gives an error: "xxx command not found".

The problem with Linux is that pip install ... drops scripts into ~/.local/bin and this is not on the default Debian/Ubuntu $PATH.

To fix it, just add ~/.local/bin to your $PATH but on fish shell:

# open config file
code ~/.config/fish/config.fish

Edit config.fish file:

set -gx PIP_HOME "/home/$USER/.local/bin"
set -gx PATH "$PIP_HOME" $PATH

Since $USER and $PATH is global variable, so we do not need to define them.

Restart a fish shell session and try to run Python packages again!

Reference