Sitemap
Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

Tools — Pyenv — Simple Python Version Management

2 min readFeb 12, 2026

--

Press enter or click to view image in full size

Introduction

pyenv is a lightweight, open-source tool that lets you install, manage, and switch between multiple Python versions on the same machine, without ever touching your system Python.
Whether you’re maintaining a legacy application on an older interpreter or experimenting with the latest Python release, pyenv gives you complete control over which Python version runs where — globally, per project, or even per shell session.

Let’s try it!

Installation and setup

One line installation

curl -fsSL https://pyenv.run | bash

Then few lines of setup

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc

# Then, if you have .profile
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
echo 'eval "$(pyenv init - bash)"' >> ~/.profile

See documentation for more details

pyenv compiles Python from source, so missing system dependencies can break the build — and even a clean compilation doesn’t always…

--

--

Stackademic
Stackademic

Published in Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.