Skip to content

Techeons

Imagine | Explore | Innovate

Menu
  • Home
Menu

Switch easily between Python versions on a Mac using pyenv

Posted on October 13, 2025

Install Pyenv:

brew install pyenv

Configure Pyenv in your shell:

# Add this to your ~/.zshrc or ~/.bash_profile
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv > /dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init ~)"

source ~/.zshrc
OR
source ~/.bash_profile

Use pyenv:

# List available Python versions
pyenv install --list

# Install a specific version
pyenv install 3.11.5
pyenv install 3.12.0

# List installed versions
pyenv versions

# Set global Python version
pyenv global 3.11.5

# Set local Python version for current directory
pyenv local 3.12.0

# Check current version
python --version
Share on Social Media
x facebook pinterest linkedin tumblr reddit emailwhatsapptelegrammastodon

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Nginx: How to increase timeout for Nginx
  • Cheat Sheet: Essential Git Commands
  • Setting a default shell in Linux
  • Setting up Composer on Linux
  • Switch easily between Python versions on a Mac using pyenv

Tags

ai alerting aws b2 backblaze certificate cheatsheet cloud commands data-science datalake devops dns docker dremio git gitlab infra jenkins kubernetes linux metabase minikube minio monitoring mount mysql nginx nodejs notebooks openssh php python scala secrets spark ssh ssl ubuntu ufw usb web dev tools windows xampp zeppelin

©2026 Techeons | Design: Newspaperly WordPress Theme