Automatically activate pyenv version from Emacs with pyenv-mode.
It traverse directories up until .python-version
file will be found and activates pyenv version defined there.
You can simply install package from Melpa.
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
And then M-x package-install [RET] pyenv-mode-auto [RET]. After Installing you should require this package:
(require 'pyenv-mode-auto)
Just open any file within you project (with .python-version
file in the same directory or above) and you pyenv version will be activated.