greta_set_deps: Choose the dependency versions greta installs

View source: R/python_backend.R

greta_set_depsR Documentation

Choose the dependency versions greta installs

Description

Persistently choose which versions of TensorFlow, TensorFlow Probability, and Python greta uses, independently of where they are installed (see greta_set_python() for that). The stored versions are used by:

  • the managed (uv) environment, which installs them automatically on first use after a restart, and

  • install_greta_deps(), as its default deps argument when building a conda environment.

Most users never need this: greta's defaults (TensorFlow 2.15.1, TensorFlow Probability 0.23.0, Python 3.11) are the newest versions greta supports.

To clear the stored versions and return to the defaults, use greta_remove()("deps").

Usage

greta_set_deps(deps = greta_deps_spec())

Arguments

deps

object created with greta_deps_spec(), which checks that the TensorFlow version is one greta supports.

Details

Your choice is stored under tools::R_user_dir("greta", "config") and applied the next time greta is loaded, so you will need to restart R for it to take effect. Changing versions on the managed (uv) backend may require internet access on the next load, to download the newly requested versions.

Value

Invisibly, the stored greta_deps_spec().

See Also

greta_set_python(), greta_deps_spec(), install_greta_deps()

Examples

## Not run: 
# pin an older TensorFlow for the managed (uv) environment
greta_set_deps(greta_deps_spec(
  tf_version = "2.14.0",
  tfp_version = "0.22.1",
  python_version = "3.10"
))

# clear the stored versions and return to greta's defaults
greta_remove("deps")

## End(Not run)

greta documentation built on July 20, 2026, 5:09 p.m.