Install text required python packages (rpp) in a self-contained environment. For macOS and Linux-based systems, this will also install Python itself via a "miniconda" environment, for textrpp_install. Alternatively, an existing conda installation may be used, by specifying its path. The default setting of "auto" will locate and use an existing installation automatically, or download and install one if none exists.

For Windows, automatic installation of miniconda installation is not currently available, so the user will need to miniconda (or Anaconda) manually.

If you wish to install Python in a "virtualenv", use the textrpp_install_virtualenv function. It requires that you have a python version and path to it (such as "/usr/local/bin/python3.9" for Mac and Linux.).

textrpp_install(
  conda = "auto",
  update_conda = FALSE,
  force_conda = FALSE,
  rpp_version = "rpp_version_system_specific_defaults",
  python_version = "python_version_system_specific_defaults",
  envname = "textrpp_condaenv",
  pip = TRUE,
  python_path = NULL,
  prompt = TRUE
)

textrpp_install_virtualenv(
  rpp_version = c("torch==2.0.0", "transformers==4.19.2", "numpy", "pandas", "nltk"),
  python_path = "/usr/local/bin/python3.9",
  pip_version = NULL,
  envname = "textrpp_virtualenv",
  prompt = TRUE
)

Arguments

conda

character; path to conda executable. Default "auto" which automatically find the path

update_conda

Boolean; update to the latest version of Miniconda after install? (should be combined with force_conda = TRUE)

force_conda

Boolean; force re-installation if Miniconda is already installed at the requested path?

rpp_version

character; default is "rpp_version_system_specific_defaults", because diffent systems require different combinations of python version and packages. It is also possible to specify your own, such as c("torch==2.0.0", "transformers==4.19.2", "numpy", "pandas", "nltk", "scikit-learn", "datasets", "evaluate").

python_version

character; default is "python_version_system_specific_defaults". You can specify your Python version for the condaenv yourself. installation.

envname

character; name of the conda-environment to install text required python packages. Default is "textrpp_condaenv".

pip

TRUE to use pip for installing rpp If FALSE, conda package manager with conda-forge channel will be used for installing rpp.

python_path

character; path to Python in virtualenv installation

prompt

logical; ask whether to proceed during the installation

pip_version

character;

Examples

if (FALSE) {
# install text required python packages in a miniconda environment (macOS and Linux)
textrpp_install(prompt = FALSE)

# install text required python packages to an existing conda environment
textrpp_install(conda = "~/anaconda/bin/")
}
if (FALSE) {
# install text required python packages in a virtual environment
textrpp_install_virtualenv()
}