Skip to main content

Command Palette

Search for a command to run...

Set PATH for Python PIP on fish shell

Published
1 min read
Set PATH for Python PIP on fish shell
L

I am a developer from Vietnam.

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

More from this blog

Vietnamese / Ja / En  🧑‍💻 blog

155 posts

Vietnamese developer 🧑‍💻