Mimic the (de)activation of a Conda environment by modifying environment variables in the current R process.
1 2 3
String containing the path to the Conda environment to activate.
String containing the path to the root of a conda instance.
Named list of strings containing name:value pairs for environment variables,
typically the output of
Conda environments generally need to be activated to function properly.
This is especially relevant on Windows where the
"PATH" variable needs to be modified for the DLL search.
.activateEnvironment function mimics the effect of activation
by modifying environment variables in the current R session.
This can be reversed by
.deactivateEnvironment once the Conda environment is no longer in use.
.activateEnvironment function will also unset a few bothersome environment variables:
"PYTHONPATH": to avoid compromising the version guarantees
import is allowed to search other locations beyond the specified Conda environment.
"PYTHONNOUSERSITE": similarly, to avoid searching the user's site libraries.
"RETICULATE_PYTHON": this would otherwise override any choice of Python,
even after explicit specification via reticulate's
"RETICULATE_PYTHON_ENV": for similar reasons.
activateEnvironment will modify environment variables to mimic activation of the Conda environment.
It returns a named list of the previous values of all variables modified in this manner.
NA values indicate that the corresponding variable was not previously set.)
deactivateEnvironment restores the environment variables to their pre-activation state.
1 2 3 4
# We can't actually run activateEnvironment() here, as it # either relies on basilisk already being installed or # it has a hard-coded path to the basilisk system dir. print("dummy test to pass BiocCheck")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.