Skip to content

pyenv

The pyenv resource reference. This resource installs pyenv, a python version manager that allows you to switch between multiple versions of Python.

Parameters:

  • global: (string) The global version of python to use.

  • nodeVersions: (array[string]) Python versions to be installed.

Example usage:

codify.json
[
{
"type": "pyenv",
"global": "3.12",
"nodeVersions": [
"3.9.6", "3.12"
]
}
]

Setting up Python

  1. Create a codify.json file anywhere.
  2. Open codify.json with your file editor and paste in the follow configs.
codify.json
[
{
"type": "pyenv",
"global": "3.12",
"nodeVersions": [
"3.12"
]
}
]
  1. Run codify apply in the directory of the file. Open a new terminal and run the command python --version to check that Python was installed. It should return Python 3.12.2.
codify.json
codify apply

Notes:

This resource currently does not support virtual envs. This is something that will be added in the future.