Thursday, May 26, 2022

[SOLVED] How can I install specific version of pyenv?

Issue

Now I am using next command to install pyenv:

curl https://pyenv.run | bash

Obviously here I can not specify version of pyenv I want to install. But that is mandatory to use pyenv in CI tools, to make builds predictable, not to depends on latest stable versions.

So how can I install pyenv of specific version on Linux like systems(not Mac OS)?


Solution

You could checkout the GitHub repository and get a specific version.

For this run:

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
cd ~/.pyenv
git checkout tag/<version>

The <version> needs to be substituted for a valid version of the repository, e.g. v2.1.0. Don't forget to add the folder to your PATH in your shell. The official repository has more information on CLI completion https://github.com/pyenv/pyenv/tree/master#basic-github-checkout



Answered By - Jonas
Answer Checked By - Terry (WPSolving Volunteer)