Cuando lo hago
which pip3
yo obtengo
/usr/local/bin/pip3
pero cuando intento ejecutar pip3me sale el siguiente error:
bash: /usr/bin/pip3: No such file or directory
Esto se debe a que recientemente eliminé ese archivo. Ahora el whichcomando apunta a otra versión de la pip3que se encuentra /usr/local/binpero el shell aún recuerda la ruta incorrecta. ¿Cómo hago que se olvide de ese camino?
El whichmanual dice
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.
Ambos /usr/local/biny /usr/binestán en mi PATHvariable, y /usr/local/bin/pip3no es un enlace simbólico, es un ejecutable. Entonces, ¿por qué no se ejecuta?
pip3en ese shell mientras estaba dentro /usr/biny luego lo movió?
hash -t pip3?
hash -t pip3imprime/usr/bin/pip3
typeeather than which. typeestá integrado en un shell posix y le dice lo que hará un shell, en lugar de lo whichque intenta adivinar qué hará el shell.
/usr/local/bin/pip3?