Install talk required python packages in conda or virtualenv environment
Source:R/0_0_talk_install.R
talkrpp_install.Rd
Install talk 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
talkrpp_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
talkrpp_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.).
Usage
talkrpp_install(
conda = "auto",
update_conda = FALSE,
force_conda = FALSE,
rpp_version = "rpp_version_system_specific_defaults",
python_version = "python_version_system_specific_defaults",
envname = "talkrpp_condaenv",
pip = TRUE,
python_path = NULL,
prompt = TRUE
)
talkrpp_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 = "talkrpp_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 talk required python packages. Default is "talkrpp_condaenv".
- pip
TRUE
to use pip for installing rpp IfFALSE
, conda package manager with conda-forge channel will be used for installing rpp.- python_path
character; path to Python only for virtualenvironment installation
- prompt
logical; ask whether to proceed during the installation
- pip_version
character;
- bin
character; e.g., "python", only for virtualenvironment installation
Examples
if (FALSE) { # \dontrun{
# install talk required python packages in a miniconda environment (macOS and Linux)
talkrpp_install(prompt = FALSE)
# install talk required python packages to an existing conda environment
talkrpp_install(conda = "~/anaconda/bin/")
} # }
if (FALSE) { # \dontrun{
# install talk required python packages in a virtual environment
talkrpp_install_virtualenv()
} # }