Last Updated: August 10, 2023
·
6.774K
· trinitronx

Select & Install python versions easily with fzf + pyenv

A nice one-liner to easliy select & install python versions from 3.8, 3.9, and 3.10 series:

pyenv install -l | fzf -m -q '^3.8 | ^3.9 | ^3.10' | xargs pyenv install
  • Move up/down with arrow keys or: Ctrl+k, Ctrl+j
  • Select/Deselect with Tab or Shift+Tab
  • When done, hit enter and go get a coffee while they build.

Alternatively, with build flags to optimize resulting python interpreter speed:

pyenv install -l | fzf -m -q '^3.8 | ^3.9 | ^3.10' | xargs env PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' PYTHON_CFLAGS='-march=native -mtune=native'  pyenv install