I use pyenv
to manage my Python environments and I get the following when simply running bash
.
$ bash
pyenv: bash: command not found
I was trying to troubleshoot why pipenv shell
failed with the above error, which is how I found out even bash
wasn't working. I tried updating pipenv
via brew
and ran pyenv rehash
to regenerate the shims. And bash
is definitely present.
$ which bash
/bin/bash
I expected that if pyenv
doesn't find a command, the subsequent paths specified by the PATH
environment variable will be searched. Interestingly if I execute some non-existant command I don't get a pyenv
error.
$ someboguscommand
-bash: someboguscommand: command not found
This suggests to me that pyenv
doesn't even search for a matching command in this case and the subsequent paths in PATH
are searched, so there must be some special handling with bash
.
type bash
say? – Dubuffet$ type bash
bash is hashed (/bin/bash)
– Incredible.bashrc
or.bash_profile
. You can runbash -x
to show a debug trace of what's going on, and where it starts to fail. Runningbash
by itself probably worked in spite of the error, and is only showing a warning about a failingpyenv
command in your.bashrc
or.bash_profile
while otherwise giving you a working shell. – DubuffetPS4=':$BASHPID:${BASH_SOURCE##*/}:$LINENO+' bash -x
, to log a process ID, source file and line number with each command in the trace log. Compare theBASHPID
in those logs with the one in your starting shell and you have a conclusive answer as to whether the error is in- or out-of-process. – Springhouse