File: configure_environment.Rd

package info (click to toggle)
r-cran-reticulate 1.41.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,088 kB
  • sloc: cpp: 5,154; python: 620; sh: 13; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 1,999 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/python-packages.R
\name{configure_environment}
\alias{configure_environment}
\title{Configure a Python Environment}
\usage{
configure_environment(package = NULL, force = FALSE)
}
\arguments{
\item{package}{The name of a package to configure. When \code{NULL}, \code{reticulate}
will instead look at all loaded packages and discover their associated
Python requirements.}

\item{force}{Boolean; force configuration of the Python environment? Note
that \code{configure_environment()} is a no-op within non-interactive \R
sessions. Use this if you require automatic environment configuration, e.g.
when testing a package on a continuous integration service.}
}
\description{
Configure a Python environment, satisfying the Python dependencies of any
loaded \R packages.
}
\details{
Normally, this function should only be used by package authors, who want
to ensure that their package dependencies are installed in the active
Python environment. For example:

\if{html}{\out{<div class="sourceCode">}}\preformatted{.onLoad <- function(libname, pkgname) \{
  reticulate::configure_environment(pkgname)
\}
}\if{html}{\out{</div>}}

If the Python session has not yet been initialized, or if the user is not
using the default Miniconda Python installation, no action will be taken.
Otherwise, \code{reticulate} will take this as a signal to install any required
Python dependencies into the user's Python environment.

If you'd like to disable \code{reticulate}'s auto-configure behavior altogether,
you can set the environment variable:

\if{html}{\out{<div class="sourceCode">}}\preformatted{RETICULATE_AUTOCONFIGURE = FALSE
}\if{html}{\out{</div>}}

e.g. in your \verb{~/.Renviron} or similar.

Note that, in the case where the Python session has not yet been initialized,
\code{reticulate} will automatically ensure your required Python dependencies
are installed after the Python session is initialized (when appropriate).
}