1

This is my PATH, with ~/.local/bin appearing before all other directories:

$ echo $PATH
/home/tessio/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

There is a pip binary located on ~/.local/bin/ directory:

$ which pip
/home/tessio/.local/bin/pip

$ /home/tessio/.local/bin/pip --version
pip 22.2.2 from /home/tessio/.local/lib/python3.8/site-packages/pip (python 3.8)

But when I run pip the binary installed from the debian package runs instead:

$ pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

$ /usr/bin/pip --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

What's going on?

EDIT 1:

$ type -a pip
pip is /home/tessio/.local/bin/pip
pip is /usr/bin/pip
pip is /bin/pip
3
  • type -a pip ? Commented Oct 3, 2022 at 18:34
  • 1
    @phd edited the post with this information Commented Oct 3, 2022 at 19:01
  • 2
    Try rehashing maybe hash -r , see also help hash. Commented Oct 3, 2022 at 19:13

1 Answer 1

1

After running

hash -r

The problem was corrected.

hash is a bash built-in command that determines and remember the full pathname of each command name. The -r option makes it forget all previous remembered locations.

Thanks to @MarkSetchell for giving a hand.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.