Nat TaylorBlog, Product Management & Tinkering

pyenv for Simple Python Version Management

Published on . Updated on

Python has an incredible ecosystem, but version management can be a chore even for things as simple as having to run python3 from the command line. pyenv (https://github.com/pyenv/pyenv) is a simple solution which can be as simple as:

  1. brew install pyenv
  2. Now modify your ~/.zshrc (or whatever) with:
    • export PYENV_ROOT="$HOME/.pyenv"
    • export PATH="$PYENV_ROOT/bin:$PATH"
  3. pyenv install 3.11 (or whatever version you want)
  4. And if you’re me pyenv global 3.11

That’s it. No more python3 non-sense.

What I really like about pynev is that it’s just shell scripts, so it is easy to get rid of, if needed.

Popular Posts

Post Navigation

«
»