obtainEnvironmentPath: Obtain the environment path

View source: R/obtainEnvironmentPath.R

obtainEnvironmentPathR Documentation

Obtain the environment path

Description

Obtain a path to a Conda environment, lazily installing it if necessary.

Usage

obtainEnvironmentPath(env)

Arguments

env

A BasiliskEnvironment object specifying the environment. Alternatively a string containing a path to an existing environment.

Value

String containing the path to an instantiated Conda environment.

For a BasiliskEnvironment env, the function will also lazily create the environment if useSystemDir() returns FALSE and the environment does not already exist.

Author(s)

Aaron Lun

Examples

if (.Platform$OS.type != "windows") {
 

 tmploc <- file.path(tempdir(), "my_package_A")
 if (!file.exists(tmploc)) {
     setupBasiliskEnv(tmploc, c('pandas=1.4.3'))
 }
 obtainEnvironmentPath(tmploc)

 env <- BasiliskEnvironment("test_env", "basilisk", 
     packages=c("scikit-learn=1.1.1", "pandas=1.43.1"))
 ## Not run: obtainEnvironmentPath(env)
}

LTLA/basilisk documentation built on Nov. 3, 2024, 3:05 p.m.