Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/useBasiliskEnv.R
Use basilisk environments for isolated execution of Python code with appropriate versions of all Python packages.
1 | useBasiliskEnv(envpath)
|
envpath |
String containing the path to the basilisk environment to use. |
It is unlikely that developers should ever need to call useBasiliskEnv
directly.
Rather, this interaction should be automatically handled by basiliskStart
.
This function will modify a suite of environment variables as a side effect
- see “Persistence of environment variables” in ?basiliskStart
for the rationale.
The function will attempt to load the specified basilisk environment into the R session,
possibly with the modification of some environment variables (see Details).
A NULL
is invisibly returned.
Aaron Lun
basiliskStart
, for how these basilisk environments should be used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | tmploc <- file.path(tempdir(), "my_package_B")
if (!file.exists(tmploc)) {
setupBasiliskEnv(tmploc, c('pandas==0.25.1',
"python-dateutil=2.8.0", "pytz=2019.3"))
}
# This may or may not work, depending on whether a Python instance
# has already been loaded into this R session.
try(useBasiliskEnv(tmploc))
# This will definitely not work, as the available Python is already set.
baseloc <- basilisk.utils::getCondaDir()
status <- try(useBasiliskEnv(baseloc))
# ... except on Windows, which somehow avoids tripping the error.
stopifnot(is(status, "try-error") || basilisk.utils::isWindows())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.