[PYTHON] How to unlock pyenv global

Introduction

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.

Official source

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.

I will check

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.

Try to cancel 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

in conclusion

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.

Postscript

It seems that you can check the version currently set in pyenv version and the location of the version file.

pyenv version

Recommended Posts

How to unlock pyenv global
How to use Pyenv
How to uninstall pyenv itself
How to install Anaconda with pyenv
How to use tkinter with python in pyenv
How to use Ruby's PyCall to enable pyenv Python
How to use xml.etree.ElementTree
How to use virtualenv
Scraping 2 How to scrape
How to use Seaboan
How to use image-match
How to use shogun
How to install Python
How to use Pandas 2
How to read PyPI
How to install pip
How to use Virtualenv
How to use numpy.vectorize
How to update easy_install
How to install archlinux
How to use pytest_report_header
How to restart gunicorn
How to install python
How to virtual host
How to debug selenium
How to use partial
How to use Bio.Phylo
How to read JSON
How to use SymPy
How to use x-means
How to use WikiExtractor.py
How to update Spyder
How to use IPython
How to install BayesOpt
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use TokyoTechFes2015
How to use venv
How to use dictionary {}
How to grow dotfiles
How to use list []
How to use python-kabusapi
"How to count Fukashigi"
How to install Nbextensions
How to use OptParse
How to use return
How to install Prover9
How to use dotenv
How to operate NumPy
How to use pyenv-virtualenv
How to use Go.mod
How to use imutils
How to use import
How to set up a Python environment using pyenv
How to deal with pyenv initialization failure in fish 3.1.0
How to access the global variable of the imported module
[2020.8 latest] How to install Python
How to estimate kernel density
[IPython] How to Share IPython Notebook