Returns the absolute path where an environment is expected under the data directory of its backend. It returns the path even if the environment does not exist yet.
Arguments
- env_name
Character string with the environment name. It must be a plain directory name that is valid on Linux, macOS and Windows:
Not empty, and not
.or...Not starting with
-, and not ending with..Without path separators,
:,#, whitespace, control characters or<>"|?*.Not a Windows device name, such as
NULorCOM1(see Environment names increate_env()).
Invalid values abort with class
condathis_invalid_env_name. Functions that take only names reject anenv_path()value with classcondathis_env_path_read_only.run(),run_bin(),run_pipeline()andrun_step()accept one.- method
Character string naming the backend.
"auto"(the default) uses the backend that ownsenv_namewhen it exists, and otherwise the first available backend ingetOption("condathis.backend_priority")order (see condathis-options). Any name fromlist_registered_backend_names()selects that backend, and"micromamba"is built in. The name of a backend whose packagecondathisknows, such as"rattler"of therattlerthispackage, also selects it.condathisloads the package on first use. It aborts with classcondathis_backend_not_installedwhen the package is not installed."native"is a deprecated alias for"micromamba"(warns once per session). If you name a backend other than the owner, functions that change the environment abort with classcondathis_backend_mismatch. The others warn (condathis_backend_mismatch_warning) and use the owner. An environment found under several backends aborts withcondathis_backend_ambiguous_envunlessmethodnames one of them. Invalid values abort with classcondathis_invalid_method.
Details
Looks up which registered backend owns env_name, and creates the
backend's data directory when needed. It creates no environment. When
env_name has no directory yet, it does not start or install
micromamba.
See also
Other environments:
create_env(),
env_exists(),
env_path(),
install_packages(),
list_envs(),
list_packages(),
remove_env(),
validate_env()
Examples
condathis::with_sandbox_dir({
# Get the default environment directory
print(condathis::get_env_dir())
#> <data dir>/R/condathis/envs/condathis-env
# Get the directory for a specific environment
condathis::get_env_dir("my-env")
#> <data dir>/R/condathis/envs/my-env
})
#> /tmp/Rtmpu60vo2/condathis-sandbox-2b123f875c5f/data/R/condathis/envs/condathis-env
#> /tmp/Rtmpu60vo2/condathis-sandbox-2b123f875c5f/data/R/condathis/envs/my-env