Setting up Pyenv in .zshrc
~/.zshrc
Setting up pyenv
- Install
pyenv
with Homebrew
- Define environment variable
PYENV_ROOT
to point to the path wherepyenv
will store its data.$HOME/.pyenv
is the default.
- Add the
pyenv
executable to yourPATH
if it's not already there
- Run
eval "$(pyenv init -)"
to installpyenv
into your shell as a shell function, enable shims and autocompletion- You may run
eval "$(pyenv init --path)"
instead to just enable shims, without shell integration
- You may run
Setting up pyevn-virtualenv
- Install
pyenv-virtualenv
via Homebrew
- Activate
pyenv-virtualenv
in the shell environment by appending the initialization script to the.zshrc
file: