
Create python virtual environment and dependencies in conda or virtualenv environment
Source:R/install_python_dependencies.R
create_python_venv.RdModified from the spacyr::spacy_install() function:
https://github.com/quanteda/spacyr/blob/master/R/spacy_install.R
Usage
create_python_venv(ask = interactive(), force = FALSE)Details
The dependencies are python, some base python packages (copy, random, collections), numpy, scipy, and pandas.
The function checks whether a suitable installation of Python is
present on the system and installs one via reticulate::install_python()
otherwise. It then creates a virtual environment with the necessary
packages in the default location chosen by reticulate::virtualenv_root().
If you want to install a different version of Python than the default, you
should call reticulate::install_python() directly. If you want to create
or use a different virtual environment, you can use, e.g.,
Sys.setenv(WAVESS_PYTHON = "path/to/directory"). If you want to install a
different version of a particular package, then use, e.g.
reticulate::virtualenv_install(packages = c("numpy==VERSION_NUM")) instead.