126

I want to know what Python versions I could install using the pyenv install command. pyenv versions lists only installed versions and does not appear to have an option to list available versions.

How can I find out what versions of Python I can install with pyenv install?

Wayne Conrad
  • 103,207
  • 26
  • 155
  • 191
  • 3
    Why I asked and answered this: I'm a Ruby programmer who uses `rvm`. In `rvm`, listing available versions is done with a variation of the command that lists installed versions, rather than the command that installs new versions. There's nothing illogical about either choice, but my long experience with rvm made me blind to the idea that the "install" command was the place to look. Searches of either google or SO didn't help; this question/answer would have saved me some time. – Wayne Conrad Sep 27 '19 at 16:45
  • 7
    this is what I call "seeding Google". I often write the answers I wish I could find so that next time I need them they'll be here. It's really satisfying when you get to the bottom of a great answer and discover that you wrote it years ago at 4am. – Bruno Bronosky Dec 16 '20 at 21:58

1 Answers1

191

pyenv accepts a switch to the install command to list available versions: --list, or -l for short:

$ pyenv install -l
Available versions:
  2.1.3
  2.2.3
  2.3.7
  2.4.0
  2.4.1
  2.4.2
...

Before running pyenv install -l, you may need to update pyenv as described here. Otherwise the list may not include the latest versions (thank you @csatt1).

Wayne Conrad
  • 103,207
  • 26
  • 155
  • 191