If you want to cancel local with pyenv, you can delete .python-version, or specify --unset like this article. However, I didn't know how to cancel global, so make a note.
This area seems to be related ・ Pyenv-global -Pyenv-version-file-write
Somehow, it feels like calling pyenv-version-file-write from pyenv-global to create a file called version under PYENV_ROOT.
Check the version first
$ python -V
Python 2.7.16
Check the configuration of PYENV_ROOT (.pyenv)
$ ls -a ~/.pyenv/
. .. shims versions
Set global to see if things have changed
$ pyenv global 3.7.5
$ python -V
Python 3.7.5
$ ls -a ~/.pyenv/
. .. shims version versions
$ cat ~/.pyenv/version
3.7.5
A version has been created, and the contents include version 3.7.5 specified by global.
$ python -V
Python 3.7.5
$ rm ~/.pyenv/version
$ ls -a ~/.pyenv
. .. shims versions
$ python -V
Python 2.7.16
I was able to return to the original interpreter by erasing the version
I was curious about this time, so I looked it up, but I wondered if there was something I wanted to cancel if I switched global in the first place.
It seems that you can check the version currently set in pyenv version and the location of the version file.
pyenv version
Recommended Posts