Skip to contents

Checks if Python environment is available and properly configured.

Usage

check_python_env(envname = "textanalysisr-env")

Arguments

envname

Character string name of the virtual environment (default: "textanalysisr-env")

Value

List with status information:

  • available: Logical, TRUE if environment exists

  • active: Logical, TRUE if environment is currently active

  • packages: List of installed package versions

Examples

if (interactive()) {
status <- check_python_env()
print(status)
}
#> $available
#> [1] TRUE
#> 
#> $active
#> [1] FALSE
#> 
#> $packages
#> NULL
#> 
#> $message
#> [1] "Failed to activate environment: failed to initialize requested version of Python"
#>