This function ensures that a suitable Python environment (virtualenv or conda) is available and that 'torch' and 'numpy' are installed within it. Users should run this once before using functions that rely on PyTorch.

deprecated.setup_py_env(
  method = c("conda", "virtualenv"),
  envname = "FastPCA",
  cuda = FALSE,
  ...
)

Arguments

method

Character string. The method to use for environment creation. Can be "virtualenv" (default) or "conda".

envname

Character string. The name of the Python environment to create/use. Defaults to "FastPCA".

...

Additional arguments passed to reticulate::virtualenv_create() or reticulate::conda_create().

python_version

Character string. The Python version to use (e.g., "3.9"). Defaults to "3.9". It's recommended to stick to well-supported versions.

Value

Invisibly returns TRUE if setup is successful, FALSE otherwise.

Examples

if (FALSE) { # \dontrun{
  #for conda
  FastPCA::setup_py_env(method = "conda")

  #reticulate virtualenv:
  FastPCA::setup_py_env()
} # }