Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding versions of Python that are available for "pyenv install"

Tags:

python

pyenv

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?

like image 592
Wayne Conrad Avatar asked Sep 27 '19 16:09

Wayne Conrad


People also ask

Where are Pyenv Python versions installed?

Once pyenv has determined which version of Python your application has specified, it passes the command along to the corresponding Python installation. Each Python version is installed into its own directory under $(pyenv root)/versions . For example, you might have these versions installed: $(pyenv root)/versions/2.7.

How do I add Python to Pyenv?

You can then use pyenv to switch to the specific python version you want to use (globally or locally). Pyenv does this by adding a shim to your $PATH which directs all python and python related tools like pip and easy_install to /. pyenv/shims/python, from here pyenv manages the various versions for us.


1 Answers

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).

like image 124
Wayne Conrad Avatar answered Sep 29 '22 12:09

Wayne Conrad