How To Install Pyenv In MacOS?

How To Install Pyenv In MacOS?

pyenv

Switch between multiple versions of Python easily.

Install pyenv

  • macOS brew install pyenv Click to copy

Switch between multiple versions of Python easily.

How to use pyenv?

Below are few example commands for pyenv that you can use in the terminal.

List all available commands:
pyenv commandsClick to copy
List all Python versions under the ${PYENV_ROOT}/versions directory:
pyenv versionsClick to copy
Install a Python version under the ${PYENV_ROOT}/versions directory:
pyenv install 2.7.10Click to copy
Uninstall a Python version under the ${PYENV_ROOT}/versions directory:
pyenv uninstall 2.7.10Click to copy
Set Python version to be used globally in the current machine:
pyenv global 2.7.10Click to copy
Set Python version to be used in the current directory and all directories below it:
pyenv local 2.7.10Click to copy
Install the latest version of pyenv in macOS from terminal. To install the pyenv just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of pyenv from the respository and install it in your computer/server.