getCondaDir: Get the 'basilisk' Conda directory

View source: R/getCondaDir.R

getCondaDirR Documentation

Get the basilisk Conda directory


Find the installation directory for the basilisk-managed Conda instance.


getCondaDir(installed = TRUE)



Logical scalar indicating whether basilisk is already installed.


By default, conda is installed to a location specified by getExternalDir. This ensures that R package build systems do not attempt to generate binaries that include the conda instance; such binaries are not relocatable due to the presence of hard-coded paths, resulting in run-time failures.

If the BASILISK_EXTERNAL_CONDA environment variable is set to a path to an existing conda instance, the function will return it directly without modification. This allows users to use their own conda instances with basilisk but, in turn, they are responsible for managing it.

If the BASILISK_USE_SYSTEM_DIR environment variable is set to "1", the function will return a path to a location inside the basilisk system installation directory. This is the ideal approach when installing from source as any conda and basilisk re-installations are synchronized. It also ensures that any R process that can load basilisk will also have permissions to access the conda instance, which makes life easier for sysadmins of clusters or other shared resources.

We suggest always calling this function after an installConda call, which guarantees the presence of the conda installation directory (or dies trying). Setting installed=FALSE should only happen inside the basilisk configure script.


String containing the path to the conda instance.


Aaron Lun


# Setting the environment variable to run this example: 
# all other modes rely on installation of basilisk.
old <- Sys.getenv("BASILISK_USE_SYSTEM_DIR")



LTLA/basilisk.utils documentation built on June 26, 2022, 4:06 a.m.