Search code examples
pythonbashpip

"bash: pip: command not found" when using "pip install ..."


On Linux Ubuntu with python 3.6.9

When i try to download pip, it says i already have it. So when i try to pip install ... it gives me error "bash: pip: command not found".

When i type "which pip" in the terminal it gives me nothing and creates a new line.

(While also it doesn't work in the normal terminal) I should also say I'm trying to do this in a virualenv. It gives the same errors when trying to install pip (I already have it) and when trying to use pip ("bash: pip: command not found")

echo $PATH output: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

sorry if this doesn't make sense, kinda a noob


Solution

  • Try the following:

    • python -m pip install ....
    • python3 -m pip install ....
    • py3 -m pip install ....

    As @S3DEV commented, there could be a problem with your path variables, so trying python before pip could solve. Those other variations (python3 and py) can also work.