install_python(version = "3.9:latest", list = FALSE, force = FALSE)
The version of Python to install.
Boolean; if set, list the set of available Python versions?
Boolean; force re-installation even if the requested version of Python is already installed?
In general, it is recommended that Python virtual environments are created
using the copies of Python installed by
install_python(). For example:
library(reticulate) version <- "3.9.12" install_python(version) virtualenv_create("my-environment", version = version) use_virtualenv("my-environment") # There is also support for a ":latest" suffix to select the latest patch release install_python("3.9:latest") # install latest patch available at python.org # select the latest 3.9.* patch installed locally virtualenv_create("my-environment", version = "3.9:latest")
On macOS and Linux this will build Python from sources, which may
take a few minutes. Installation will be faster if some build
dependencies are preinstalled. See
example commands you can run to pre-install system dependencies
(requires administrator privileges).
Python is built with
On Windows, prebuilt installers from https://www.python.org are used.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.