pip 安装包时报错 /usr/bin/pip: No such file or directory

时间:2022-01-15 02:15:29

在ubuntu中使用pip报一下错误:
/usr/bin/pip: No such file or directory pip can no longer be found:

可以采用以下方式解决

  • which pip
    /usr/local/bin/pip

  • pip
    -su: /usr/bin/pip: No such file or directory

  • type pip
    pip is hashed (/usr/bin/pip)
    So pip is definintely in /usr/local/bin/pip but it is been cached as in /usr/bin/pip, thanks to the * question, the solution is very simple:

  • hash -r
    When the cache is clear, pip is working again.

这样之后在进行操作,就可以使用pip了。