当我做
which pip3
Run Code Online (Sandbox Code Playgroud)
我得到
/usr/local/bin/pip3
Run Code Online (Sandbox Code Playgroud)
但是当我尝试执行时pip3,出现如下错误:
bash: /usr/bin/pip3: No such file or directory
Run Code Online (Sandbox Code Playgroud)
这是因为我最近删除了该文件。现在which命令指向的另一个版本pip3是位于/usr/local/bin但外壳还记得在错误的道路。我如何让它忘记那条路?
该which手册说
which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in
a strictly POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments. It does not follow
symbolic links.
Run Code Online (Sandbox Code Playgroud)
双方/usr/local/bin并/usr/bin …