What to do if you should have switched the Python version with pyenv but it doesn't.
$ which python
/usr/bin
In that case, Python is installed by default / usr / bin has a higher priority than / usr / local where pyenv is installed.
$ vim /etc/paths
/usr/bin
/bin
/usr/local/bin
/usr/sbin
/sbin
/usr/local/sbin
To
/usr/local/bin
/usr/bin
/bin
/usr/local/sbin
/usr/sbin
/sbin
Raise the priority of / usr / local / ~.
$ which python
/usr/local/bin/pyenv
Should be.
If it still does not switch, Should have been set in ~ / .bash_profile
eval "$(pyenv init -)"
It seems that is not running, so let's hit it directly in the terminal. It may not be executed when the terminal is opened for some reason. (Sorry, the shell word is refreshing) → (Addition) It will be executed properly just by commenting in ~ / .bash_profile (programmer's waste!)
Recommended Posts