How to List CPython on Pyenv
Python, with its dominant status, does not have an easy way to install and kickstart the experience for beginners or anyone who simply wishes to run Python scripts. Fortunately, for most modern systems, it comes packaged with some version of Python — which is also inevitably an open invitation for disaster. Python has been changing rapidly since version 3, and some of the scripts written in post 3.0 era are inherently incompatible with historical versions that may have been shipped with the OS. This is where pyenv comes in.
pyenv is a great tool to manage all manners of versions of Python, but it lacks one function I need from it: a flag to list only CPython or reference Python. I understand pyenv is most useful while managing different implementations of Pythons, like PyPy, but the reference is what I lean on the most while I am doing DIYs.
From the machine where pyenv is already installed, run the following command to list only the CPython:
On macOS or Linux, use Terminal:
pyenv install -l | grep -E "^\s+[0-9]"
On Windows, use Command Prompt:
pyenv install -l | findstr /R "^[ ]*[0-9]"
One thing to note, grep is not available on Windows. So I used findstr for the command, otherwise the commands are nearly identical.
At the time of the writing, these commands list all the 2.x and 3.x with the minors and micros as well. I don’t recommend going to a developer version unless needed for the obvious reasons.

Comments will be automatically closed after 30 days.