1

I recently installed a /usr/local copy of python3.3.2 and when convinced it was solid, re-installed under /usr and removed the /usr/local version. When I run the executable as /usr/bin/python3.3, everything is fine but when I run it as 'python3.3' I get the message:

> python3.3
bash: /usr/local/bin/python3.3: No such file or directory

'which' finds /usr/bin/python3.3. I did a 'set -u' and 'set echo' trying to figure out what is going on without success. How is bash getting in here?

Thank you. Steve S.

0

2 Answers 2

2

Your executable file is still remembered by the shell as if it's done with hash:

hash: hash [-lr] [-p pathname] [-dt] [name ...]
    Remember or display program locations.

    Determine and remember the full pathname of each command NAME.  If
    no arguments are given, information about remembered commands is displayed.

      -r                forget all remembered locations

Running hash -r without needing to restart your shell would fix that.

Update: Actually the shell also remembers it not just by running through hash. Perhaps when you try to execute it or do things like type -P prog, the shell would remember it already. This is the error I had on my test and I didn't run w:

bash: /usr/local/bin/w: No such file or directory

And hash -r fixed it.

Sign up to request clarification or add additional context in comments.

1 Comment

Ah -- thank you very much. That fixed it. I tried 'rehash' from my old sun/unix/c-shell days and that didn't help.
0

It seems like bash is caching the previous location of python3.3 somewhere. Try closing your shell and logging in once again - that should wipe the cache and allow bash to pick up the proper location of python3.3.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.