Pyenv Giving Shopt Command Not Found Error On Macos
Solution 1:
According to your info and comments it seems your issue has 3 causes working hand in hand:
- pyenv is a bash (and bash-only) script with a shebang line
#!/usr/bin/env bash
/usr/local/bin
comes before/usr/bin
or/bin
in your PATH, so executables therein are picked up first by/usr/bin/env
(desired behaviour, especially when using homebrew)/usr/local/bin/bash
is symlinked to/bin/zsh
!?!
So in the end you are running pyenv with zsh, which, albeit being a close replacement for bash, doesn't know about shopt and therefore chokes. I don't know why the symlink is in place, but it shouldn't, because zsh is not a fully compatible drop-in replacement for bash.
I'd suggest to
(in case you are using homebrew) Check if you have/had
bash
installed through homebrew (which was later somehow replaced by a symlink to zsh):# shows only top-level packages (directly installed) brew leaves # shows *all* packages with dependency tree brew deps --tree--installed
And uninstall bash if not required anymore (which should then remove
/usr/local/bin/bash
).Either delete or at least rename the culprit:
mv /usr/local/bin/bash /usr/local/bin/bash_link_to_zsh
Or, if some program requires
/usr/local/bin/bash
to be in place, just have it point to/bin/bash
.
Post a Comment for "Pyenv Giving Shopt Command Not Found Error On Macos"