prepare_session: Function for setting up a python environment within R.

View source: R/install_and_config.R

prepare_sessionR Documentation

Function for setting up a python environment within R.

Description

This functions checks for python and a specified environment. If the environment exists it will be activated. If python is already initialized it uses the current environment.

Usage

prepare_session(
  env_type = "auto",
  envname = "aifeducation",
  check_session = TRUE
)

Arguments

env_type

string If set to "venv" virtual environment is requested. If set to "conda" a 'conda' environment is requested. If set to "auto" the function tries to activate a virtual environment with the given name. If this environment does not exist it tries to activate a conda environment with the given name. If this fails the default virtual environment is used.

envname

string envname name of the requested environment.

check_session

bool If TRUE functions checks if all necessary python packages are available. Set this argument to FALSE can speed up sessions' preparation. Set this argument to FALSE only if you are certain that the requirements for the package are satisfied.

Value

Function does not return anything. It is used for preparing python and R.

See Also

Other Installation and Configuration: check_aif_py_modules(), get_recommended_py_versions(), install_aifeducation(), install_aifeducation_studio(), install_py_modules(), set_transformers_logger(), update_aifeducation()


aifeducation documentation built on March 3, 2026, 1:06 a.m.