Dung (Donny) Nguyen

Senior Software Engineer

Installing pyenv on Mac

Installing pyenv on a Mac is straightforward, especially if you’re using Homebrew, the popular macOS package manager. Here’s a step-by-step guide to get you up and running:


🛠️ Step-by-Step: Installing Pyenv on macOS

1. Install Homebrew (if you haven’t already)

Open Terminal and run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Install pyenv via Homebrew

brew update
brew install pyenv

3. Configure your shell

Add the following to your shell configuration file:

Then restart your terminal or run:

source ~/.zshrc   # or source ~/.bash_profile

4. Install Python versions

pyenv install 3.11.6
pyenv install 3.10.13

5. Set global or local Python version


✅ Verify Installation

Run:

pyenv versions
python --version

If everything’s set up correctly, python should point to the version managed by pyenv.