R/0_0_text_install.R
textrpp_install.Rd
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 install 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 = NULL,
pip_version = NULL,
bin = "python3",
envname = "textrpp_virtualenv",
prompt = TRUE
)
character; path to conda executable. Default "auto" which automatically find the path
Boolean; update to the latest version of Miniconda after install? (should be combined with force_conda = TRUE)
Boolean; force re-installation if Miniconda is already installed at the requested path?
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").
character; default is "python_version_system_specific_defaults". You can specify your Python version for the condaenv yourself. installation.
character; name of the conda-environment to install text required python packages. Default is "textrpp_condaenv".
TRUE
to use pip for installing rpp If FALSE
, conda
package manager with conda-forge channel will be used for installing rpp.
character; path to Python only for virtualenvironment installation
logical; ask whether to proceed during the installation
character;
character; e.g., "python", only for virtualenvironment installation
if (FALSE) { # \dontrun{
# 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) { # \dontrun{
# install text required python packages in a virtual environment
textrpp_install_virtualenv()
} # }