use_python {renv} | R Documentation |
Associate a version of Python with your project.
use_python( python = NULL, ..., type = c("auto", "virtualenv", "conda", "system"), name = NULL, project = NULL )
python |
The path to a Python binary. This can be the path to a Python
binary on the system, or the path to a Python binary within an
already-existing Python environment. If |
... |
Optional arguments; currently unused. |
type |
The type of Python environment to use. When |
name |
The name or path that should be used for the associated Python
environment. If |
project |
The project directory. If |
When Python integration is active, renv
will:
Save metadata about the requested version of Python in renv.lock
– in
particular, the Python version, and the Python type ("virtualenv", "conda",
"system"),
On load, set the RETICULATE_PYTHON
environment variable, so that the
reticulate
package can automatically use the requested copy of Python
as appropriate,
Capture the set of installed Python packages during renv::snapshot()
,
Reinstall the set of recorded Python packages during renv::restore()
.
TRUE
, indicating that the requested version of Python has been
successfully activated. Note that this function is normally called for
its side effects.
## Not run: # use python with a project renv::use_python() # use virtualenv python with a project renv::use_python(type = "virtualenv") # use conda python with a project renv::use_python(type = "conda") ## End(Not run)