I often run into the case where I'm working inside a Python virtualenv, and I want to run an executable Python program (e.g., bpython). I run it, forgetting that I have not installed it in my virtualenv so it won't do the right thing. Then, I install bpython in my virtualenv, but if I try to run the new version, bash "remembers" the old one and calls it instead.
To be more concrete:
(venv)$ bpython (whoops, system-level bpython!) (venv)$ which bpython /usr/local/bin/bpython (venv)$ type bpython bpython is hashed (/usr/local/bin/bpython) (venv)$ pip install bpython (venv)$ which bpython /Users/lorin/.virtualenvs/venv/bin/bpython (venv)$ type bpython bpython is hashed (/usr/local/bin/bpython)
How do I tell the bash prompt to "forget" that the location of bpython is
/usr/local/bin/bpython for that session?