After updating pip with sudo pip install --upgrade pip
, I tried various pip commands, but it said bash: / usr / bin / pip: No such file or directory
.
hash -r
Running hash -r
in the terminal fixed it.
According to the Reference Site
When the shell executes a command that is not a built-in command, it is necessary to search the environment variable PATH for the corresponding executable file, but frequently used commands are stored in a place called "hash table". "Hash" is a command to display, delete, and add this hash table.
In short, ** OS remembers "non-built-in, frequently used commands" in a hash table **. In other words
Is it like that?
According to the Reference Site
hash -r
clears the path information stored in the hash table
It seems. This seems to erase even the memories that you do not want to delete other than the information of the previous version. Therefore,
hash -d command name
deletes the memory corresponding to the command name.
Also,
If you execute only
hash
, the path name stored in the hash table and the number of times the command was executed in that path will be displayed.
Next time, I will check the hash table with hash
and delete only unnecessary memories with hash -d command name
.
Recommended Posts