Using pyenv to Install Python
Now that you’ve installed
pyenv, installing a specific version of Python is the next step. You have many versions of Python to choose from and to see all available Python versions, you can run the command
pyenv install --list.
This is a very long list that might be tough to scroll through, so let’s use the power of
grep to see all available CPython versions for version 3.8 and 3.9.
pyenv install --list | grep with a certain filter. And if you would like to know which versions of Jython can be installed by
pyenv, you can figure that out just as easy by typing
pyenv install --list | grep "jython".
Once you’ve figured out which version you want, you can install it with a single command,
pyenv install -v 3.9.1. The
-v flag is added so
pyenv will show what it is doing.
Installing a version might take awhile because
pyenv is building from source, but I have fast-forwarded so you don’t have to wait until the installation is finished.
01:30 For the rest of the course, the examples assume you’ve installed CPython version 3.9.1, but you’re free to substitute these values for the Python versions you actually installed. Also note that the system Python version in the examples is 2.7.12.
Let’s have a look in the next lesson where
pyenv actually installed Python 3.9.1.
Become a Member to join the conversation.